Kotlin repeatable @annotations do not work on jdk-8

I declared repeatable annotation @Parameterin as below:

@Repeatable
annotation class Parameter(val name: String);

but when I use it as below, the compiler reports an error:

Only annotations preserving SOURCE can be repeated in JVM versions up to 1.8

@Parameter("foo")
@Parameter("bar")
fun repeat() = 1;

I am sure that I work with jdk-8in Kotlin . and the option is jvmTargetalso set to 1.8for the kotlin-1.1.2gradle plugin.

Q: Why is this not working fine?

sourceCompatibility = 1.8
targetCompatibility = 1.8

compileKotlin {
    kotlinOptions{
        jvmTarget = "1.8"
    }
}
+4
source share
3 answers

, Kotlin JDK 1.6. , Java .

Kotlin , 1.8, - .

+1

Kotlin IntelliJ. IntelliJ gradle . IDEA Kotlin.

0

Source: https://habr.com/ru/post/1679251/


All Articles