Use isJvmInterface in JVM back-end instead of isInterface
To support const vals and proper initialization order for companions of annotations (since 1.3+) as well as interfaces #KT-16962 Fixed
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
// !LANGUAGE: +NestedClassesInAnnotations
|
||||
// WITH_RUNTIME
|
||||
// TARGET_BACKEND: JVM
|
||||
// FILE: Foo.java
|
||||
|
||||
@Anno(Anno.CONST)
|
||||
public class Foo {}
|
||||
|
||||
// FILE: Anno.kt
|
||||
|
||||
annotation class Anno(val value: Int) {
|
||||
companion object {
|
||||
const val CONST = 42
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String =
|
||||
if ((Foo::class.java.annotations.single() as Anno).value == 42) "OK" else "Fail"
|
||||
|
||||
Reference in New Issue
Block a user