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:
@@ -1560,6 +1560,11 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/defaultArguments"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("inheritedInterfaceFunction.kt")
|
||||
public void testInheritedInterfaceFunction() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/defaultArguments/inheritedInterfaceFunction.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt11962.kt")
|
||||
public void testKt11962() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/defaultArguments/kt11962.kt");
|
||||
|
||||
Reference in New Issue
Block a user