Don't generate final modifier on static interface methods produced by @JvmStatic+@JvmOverloads from interface companion

#KT-35716 Fixed
This commit is contained in:
Mikhael Bogdanov
2020-10-30 19:21:42 +01:00
parent 7d0e9654bd
commit 7ec2d036ae
6 changed files with 53 additions and 2 deletions
+29
View File
@@ -0,0 +1,29 @@
// JVM_TARGET: 1.8
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: Test.java
class Test {
public static String test1() {
return A.sayHello();
}
}
// FILE: simpleCompanionObject.kt
interface A {
companion object {
@JvmStatic
@JvmOverloads
fun sayHello(greeting: String = "OK"): String {
return greeting
}
}
}
fun box(): String {
if (Test.test1() != "OK") return "fail 1"
return "OK"
}