[K/N] Fix: Ignore bridge functions in FunctionReferenceLowering
^KT-59858
This commit is contained in:
committed by
Space Team
parent
f3833fdcf8
commit
8aacdb471b
+6
@@ -48607,6 +48607,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
|||||||
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt59858.kt")
|
||||||
|
public void testKt59858() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/sam/kt59858.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nonInlinedSamWrapper.kt")
|
@TestMetadata("nonInlinedSamWrapper.kt")
|
||||||
public void testNonInlinedSamWrapper() throws Exception {
|
public void testNonInlinedSamWrapper() throws Exception {
|
||||||
|
|||||||
+6
@@ -48607,6 +48607,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
|||||||
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt59858.kt")
|
||||||
|
public void testKt59858() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/sam/kt59858.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nonInlinedSamWrapper.kt")
|
@TestMetadata("nonInlinedSamWrapper.kt")
|
||||||
public void testNonInlinedSamWrapper() throws Exception {
|
public void testNonInlinedSamWrapper() throws Exception {
|
||||||
|
|||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
// MODULE: A
|
||||||
|
// FILE: A.kt
|
||||||
|
interface Base {
|
||||||
|
fun f() : Any
|
||||||
|
}
|
||||||
|
|
||||||
|
fun interface Child : Base {
|
||||||
|
override fun f() : Int
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: B(A)
|
||||||
|
// FILE: B.kt
|
||||||
|
fun box(): String {
|
||||||
|
if (Child { 10 }.f() != 10) return "FAIL"
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
+6
@@ -45841,6 +45841,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt59858.kt")
|
||||||
|
public void testKt59858() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/sam/kt59858.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nonInlinedSamWrapper.kt")
|
@TestMetadata("nonInlinedSamWrapper.kt")
|
||||||
public void testNonInlinedSamWrapper() throws Exception {
|
public void testNonInlinedSamWrapper() throws Exception {
|
||||||
|
|||||||
+6
@@ -48607,6 +48607,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt59858.kt")
|
||||||
|
public void testKt59858() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/sam/kt59858.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nonInlinedSamWrapper.kt")
|
@TestMetadata("nonInlinedSamWrapper.kt")
|
||||||
public void testNonInlinedSamWrapper() throws Exception {
|
public void testNonInlinedSamWrapper() throws Exception {
|
||||||
|
|||||||
+6
@@ -48607,6 +48607,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
|
|||||||
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt59858.kt")
|
||||||
|
public void testKt59858() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/sam/kt59858.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nonInlinedSamWrapper.kt")
|
@TestMetadata("nonInlinedSamWrapper.kt")
|
||||||
public void testNonInlinedSamWrapper() throws Exception {
|
public void testNonInlinedSamWrapper() throws Exception {
|
||||||
|
|||||||
+5
@@ -38928,6 +38928,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt59858.kt")
|
||||||
|
public void testKt59858() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/sam/kt59858.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("nonInlinedSamWrapper.kt")
|
@TestMetadata("nonInlinedSamWrapper.kt")
|
||||||
public void testNonInlinedSamWrapper() throws Exception {
|
public void testNonInlinedSamWrapper() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/sam/nonInlinedSamWrapper.kt");
|
runTest("compiler/testData/codegen/box/sam/nonInlinedSamWrapper.kt");
|
||||||
|
|||||||
+6
@@ -33877,6 +33877,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt59858.kt")
|
||||||
|
public void testKt59858() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/sam/kt59858.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
|||||||
+6
@@ -33877,6 +33877,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt59858.kt")
|
||||||
|
public void testKt59858() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/sam/kt59858.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
|||||||
+6
@@ -33877,6 +33877,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
|
|||||||
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt59858.kt")
|
||||||
|
public void testKt59858() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/sam/kt59858.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
|||||||
+4
-1
@@ -343,7 +343,10 @@ internal class FunctionReferenceLowering(val generationState: NativeGenerationSt
|
|||||||
val remappedSuperType = (samSuperType.classOrNull ?: error("Expected a class but was: ${samSuperType.render()}"))
|
val remappedSuperType = (samSuperType.classOrNull ?: error("Expected a class but was: ${samSuperType.render()}"))
|
||||||
.typeWith(samSuperType.remappedTypeArguments())
|
.typeWith(samSuperType.remappedTypeArguments())
|
||||||
superTypes += remappedSuperType
|
superTypes += remappedSuperType
|
||||||
transformedSuperMethod = remappedSuperType.classOrNull!!.functions.single { it.owner.modality == Modality.ABSTRACT }.owner
|
transformedSuperMethod = remappedSuperType.classOrNull!!.functions.single {
|
||||||
|
val function = it.owner
|
||||||
|
function.modality == Modality.ABSTRACT && function.origin !is DECLARATION_ORIGIN_BRIDGE_METHOD
|
||||||
|
}.owner
|
||||||
} else {
|
} else {
|
||||||
val numberOfParameters = unboundFunctionParameters.size
|
val numberOfParameters = unboundFunctionParameters.size
|
||||||
if (isSuspend) {
|
if (isSuspend) {
|
||||||
|
|||||||
+6
@@ -37197,6 +37197,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
|
|||||||
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt59858.kt")
|
||||||
|
public void testKt59858() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/sam/kt59858.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
|||||||
+6
@@ -38143,6 +38143,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
|
|||||||
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt59858.kt")
|
||||||
|
public void testKt59858() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/sam/kt59858.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
|||||||
+6
@@ -36725,6 +36725,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
|||||||
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt59858.kt")
|
||||||
|
public void testKt59858() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/sam/kt59858.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
|||||||
+6
@@ -37198,6 +37198,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
|
|||||||
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt59858.kt")
|
||||||
|
public void testKt59858() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/sam/kt59858.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
|||||||
Generated
+6
@@ -33547,6 +33547,12 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes
|
|||||||
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt59858.kt")
|
||||||
|
public void testKt59858() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/sam/kt59858.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
|||||||
Generated
+6
@@ -33547,6 +33547,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest
|
|||||||
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
runTest("compiler/testData/codegen/box/sam/kt56188.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt59858.kt")
|
||||||
|
public void testKt59858() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/sam/kt59858.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
@TestMetadata("compiler/testData/codegen/box/sam/adapters")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
|||||||
Reference in New Issue
Block a user