Fix Kotlin default interface methods calls for inline classes
When mapping callable method signature for erased inline class methods, use original function descriptor instead of super declaration (otherwise it would map to a default interface method with mismatching signature). When generating delegates to Kotlin default interface methods, keep track of the original Kotlin types for delegating method arguments and interface method arguments. 'original' for value parameters of fake overrides points to the overridden function value parameters instead of the value parameter of the unsubstituted function. This causes inconsistent type mapping for inline classes implementing generic interfaces with default methods. #KT-25295 Fixed Target versions 1.3.20 #KT-26931 Fixed Target versions 1.3.20
This commit is contained in:
+38
@@ -12064,6 +12064,44 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/hiddenConstructor/secondaryConstructor.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class InterfaceMethodCalls extends AbstractBlackBoxCodegenTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInInterfaceMethodCalls() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("defaultInterfaceExtensionFunCall.kt")
|
||||
public void testDefaultInterfaceExtensionFunCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/defaultInterfaceExtensionFunCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("defaultInterfaceMethodCall.kt")
|
||||
public void testDefaultInterfaceMethodCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/defaultInterfaceMethodCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericDefaultInterfaceMethodCall.kt")
|
||||
public void testGenericDefaultInterfaceMethodCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericDefaultInterfaceMethodCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericInterfaceMethodCall.kt")
|
||||
public void testGenericInterfaceMethodCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericInterfaceMethodCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("overriddenDefaultInterfaceMethodCall.kt")
|
||||
public void testOverriddenDefaultInterfaceMethodCall() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/overriddenDefaultInterfaceMethodCall.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/innerNested")
|
||||
|
||||
Reference in New Issue
Block a user