mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 08:31:30 +00:00
JVM IR: fix InterfaceLowering for $default methods from base interfaces
The first change here is swapping the isCompatibility and hasJvmDefault checks. Otherwise behavior could be different depending on -Xjvm-default mode even for non-JvmDefault declarations, which makes little sense. Another change is avoiding generating $default stubs for fake overrides in interfaces, which replicates the behavior of the current backend. (Note that this change also fixes the first problem on the newly added tests, but the first change seems useful anyway.)
This commit is contained in:
15
compiler/testData/codegen/bytecodeText/defaultArguments/inheritedInterfaceFunction.kt
vendored
Normal file
15
compiler/testData/codegen/bytecodeText/defaultArguments/inheritedInterfaceFunction.kt
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// FILE: I.kt
|
||||
|
||||
interface I {
|
||||
fun foo(x: String = "OK"): String = x
|
||||
}
|
||||
|
||||
// FILE: J.kt
|
||||
|
||||
interface J : I
|
||||
|
||||
// @I$DefaultImpls.class:
|
||||
// 1 foo\$default
|
||||
|
||||
// @J$DefaultImpls.class:
|
||||
// 0 foo\$default
|
||||
Reference in New Issue
Block a user