Generate correct names for companion @JvmStatic accessors in annotation class

#KT-31389 Fixed
This commit is contained in:
Mikhael Bogdanov
2020-12-09 10:21:04 +01:00
parent 3e0efeef31
commit 1cfb81455c
11 changed files with 134 additions and 1 deletions
+36
View File
@@ -0,0 +1,36 @@
// 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()
}