Kotlin with spring in trouble,Error:(18, 65) Kotlin: Expecting an element

@kotlin hi, i’m use kotlin with anno and spring,now i have a problem.please see it in java code:

@ComponentScan(basePackages = "com.kis",excludeFilters = @ComponentScan.Filter({Controller.class, RestController.class,Configuration.class}))

when it convert to kotlin.it’s can’t work.like this

@ComponentScan(basePackages = "com.kis", excludeFilters = @ComponentScan.Filter({Controller.class, RestController.class,Configuration.class}))

i can change basePackages=arrayOf("com.kis.config") but about excludeFilters i have no way…

how can i do?
btw:what is the direction of kotlin for future? android or web(j2ee)

excludeFilters = arrayOf(ComponentScan.Filter({Controller::class, RestController::class,Configuration::class})))

That should do it :slightly_smiling:

no,it can’t work

thank you

oh
thank you i get it

must use like this

@ComponentScan(excludeFilters = arrayOf(ComponentScan.Filter(Controller::class),ComponentScan.Filter(RestController::class),ComponentScan.Filter(Configuration::class))
```
1 Like