[JVM_IR] Fix mangling of inline class inherited interface methods.
^KT-49864 Fixed
This commit is contained in:
committed by
teamcityserver
parent
887e91328f
commit
09da67767e
+12
@@ -21219,6 +21219,18 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineClassInheritingDefaultMethod.kt")
|
||||||
|
public void testInlineClassInheritingDefaultMethod() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/inlineClassInheritingDefaultMethod.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineClassInheritingDefaultMethodAll.kt")
|
||||||
|
public void testInlineClassInheritingDefaultMethodAll() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/inlineClassInheritingDefaultMethodAll.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("javaDefaultMethod.kt")
|
@TestMetadata("javaDefaultMethod.kt")
|
||||||
public void testJavaDefaultMethod() throws Exception {
|
public void testJavaDefaultMethod() throws Exception {
|
||||||
|
|||||||
+2
-3
@@ -72,9 +72,8 @@ class MemoizedInlineClassReplacements(
|
|||||||
when {
|
when {
|
||||||
it.isRemoveAtSpecialBuiltinStub() ->
|
it.isRemoveAtSpecialBuiltinStub() ->
|
||||||
null
|
null
|
||||||
it.isInlineClassMemberFakeOverriddenFromJvmDefaultInterfaceMethod() ->
|
it.isInlineClassMemberFakeOverriddenFromJvmDefaultInterfaceMethod() ||
|
||||||
null
|
it.origin == IrDeclarationOrigin.IR_BUILTINS_STUB ->
|
||||||
it.origin == IrDeclarationOrigin.IR_BUILTINS_STUB ->
|
|
||||||
createMethodReplacement(it)
|
createMethodReplacement(it)
|
||||||
else ->
|
else ->
|
||||||
createStaticReplacement(it)
|
createStaticReplacement(it)
|
||||||
|
|||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
// TARGET_BACKEND: JVM
|
||||||
|
// JVM_TARGET: 1.8
|
||||||
|
|
||||||
|
interface I {
|
||||||
|
fun foo(): A = A("OK")
|
||||||
|
}
|
||||||
|
|
||||||
|
inline class A(val x: String): I { }
|
||||||
|
|
||||||
|
fun box() = A("").foo().x
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
// !JVM_DEFAULT_MODE: all
|
||||||
|
// TARGET_BACKEND: JVM
|
||||||
|
// JVM_TARGET: 1.8
|
||||||
|
|
||||||
|
interface I {
|
||||||
|
fun foo(): A = A("OK")
|
||||||
|
}
|
||||||
|
|
||||||
|
inline class A(val x: String): I { }
|
||||||
|
|
||||||
|
fun box() = A("").foo().x
|
||||||
+12
@@ -21057,6 +21057,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineClassInheritingDefaultMethod.kt")
|
||||||
|
public void testInlineClassInheritingDefaultMethod() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/inlineClassInheritingDefaultMethod.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineClassInheritingDefaultMethodAll.kt")
|
||||||
|
public void testInlineClassInheritingDefaultMethodAll() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/inlineClassInheritingDefaultMethodAll.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("javaDefaultMethod.kt")
|
@TestMetadata("javaDefaultMethod.kt")
|
||||||
public void testJavaDefaultMethod() throws Exception {
|
public void testJavaDefaultMethod() throws Exception {
|
||||||
|
|||||||
+12
@@ -21219,6 +21219,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineClassInheritingDefaultMethod.kt")
|
||||||
|
public void testInlineClassInheritingDefaultMethod() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/inlineClassInheritingDefaultMethod.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineClassInheritingDefaultMethodAll.kt")
|
||||||
|
public void testInlineClassInheritingDefaultMethodAll() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/inlineClassInheritingDefaultMethodAll.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("javaDefaultMethod.kt")
|
@TestMetadata("javaDefaultMethod.kt")
|
||||||
public void testJavaDefaultMethod() throws Exception {
|
public void testJavaDefaultMethod() throws Exception {
|
||||||
|
|||||||
+10
@@ -17550,6 +17550,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineClassInheritingDefaultMethod.kt")
|
||||||
|
public void testInlineClassInheritingDefaultMethod() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/inlineClassInheritingDefaultMethod.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineClassInheritingDefaultMethodAll.kt")
|
||||||
|
public void testInlineClassInheritingDefaultMethodAll() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/inlineClassInheritingDefaultMethodAll.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("javaDefaultMethod.kt")
|
@TestMetadata("javaDefaultMethod.kt")
|
||||||
public void testJavaDefaultMethod() throws Exception {
|
public void testJavaDefaultMethod() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethod.kt");
|
runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/javaDefaultMethod.kt");
|
||||||
|
|||||||
+12
@@ -21440,6 +21440,18 @@ public class NativeExtBlackBoxTestGenerated extends AbstractNativeBlackBoxTest {
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineClassInheritingDefaultMethod.kt")
|
||||||
|
public void testInlineClassInheritingDefaultMethod() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/inlineClassInheritingDefaultMethod.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineClassInheritingDefaultMethodAll.kt")
|
||||||
|
public void testInlineClassInheritingDefaultMethodAll() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/jvm8DefaultInterfaceMethods/inlineClassInheritingDefaultMethodAll.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("javaDefaultMethod.kt")
|
@TestMetadata("javaDefaultMethod.kt")
|
||||||
public void testJavaDefaultMethod() throws Exception {
|
public void testJavaDefaultMethod() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user