2016-04-10 240 views
1

我一直在尝试使用温泉@AliasFor标注在科特林项目,但它似乎在注释参数标注在运行时不可见的(因此它没有拾起春季)。科特林+春AliasFor

例如:

@RequestMapping(method = arrayOf(RequestMethod.POST)) 
annotation class PostMapping(
    @get:AliasFor(annotation = RequestMapping::class, attribute = "value") 
    vararg val value: String = arrayOf()) 

而且......

// Returns empty array instead of array with the @AliasFor annotation 
PostMapping::class.java.methods[0].annotations 

有我丢失的东西?

回答

4

这是Kotlin中的一个错误,目前尚未修复:KT-11475

+1

与此同时,您可以使用Java编写这一个类。 –

+0

感谢您的信息! – Arthur