I'm using IDEA 14.1.4 and both Kotlin 0.13.1513 and 0.13.1514 to test this.
This is from documentation:
@Target([AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.EXPRESSION])
@Retention(AnnotationRetention.SOURCE) @MustBeDocumented
public annotation class Fancy
Error: CLASS is not annotation class
It should be without bracket since it’s a vararg:
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.EXPRESSION)
And then also from the documentation, using annotation with Lamda:
val f = @Suspendable { Fiber.sleep(10) }
Error: This annotation is not applicable to target 'expression'
That @Suspendable is from Java, how do I add @Target to existing annotation from Java?