Files
kotlin-fork/compiler/testData/codegen/box/jvmStatic/kt31389.kt
T
2020-12-09 13:26:14 +01:00

37 lines
675 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// WITH_RUNTIME
// FILE: Test.java
class Test {
public static String foo() {
return Annotation.getTEST_FIELD();
}
public static String foo2() {
return Annotation.getTEST_FIELD2();
}
public static void foo2Set() {
Annotation.setTEST_FIELD2("OK");
}
}
// FILE: kt31389.kt
annotation class Annotation {
companion object {
@JvmStatic val TEST_FIELD = "OK"
var TEST_FIELD2 = ""
@JvmStatic get
@JvmStatic set
}
}
fun box(): String {
if (Test.foo() != "OK") return "Fail 1: ${Test.foo()}"
Test.foo2Set()
return Test.foo2()
}