Don't generate final modifier on static interface methods produced by @JvmStatic+@JvmOverloads from interface companion
#KT-35716 Fixed
This commit is contained in:
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user