Psi2ir: fix function type check for fun interface conversion

Parameter of a synthetic SAM adapter always has a function type (not a
subtype). Checking for the subtypes broke the case from KT-46908, where
fun interface is itself a subtype of a function type.

 #KT-46908 Fixed
This commit is contained in:
Alexander Udalov
2021-09-29 16:17:01 +02:00
parent e6a160e115
commit 9857af7823
18 changed files with 173 additions and 2 deletions
@@ -11905,6 +11905,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/funInterface/kt46512_indyFunInterfaceOverCallableReference.kt");
}
@TestMetadata("kt46908_functionSupertype.kt")
public void testKt46908_functionSupertype() throws Exception {
runTest("compiler/testData/codegen/box/funInterface/kt46908_functionSupertype.kt");
}
@TestMetadata("multimodule.kt")
public void testMultimodule() throws Exception {
runTest("compiler/testData/codegen/box/funInterface/multimodule.kt");
@@ -11311,6 +11311,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/funInterface/kt46512_indyFunInterfaceOverCallableReference.kt");
}
@TestMetadata("kt46908_functionSupertype.kt")
public void testKt46908_functionSupertype() throws Exception {
runTest("compiler/testData/codegen/box/funInterface/kt46908_functionSupertype.kt");
}
@TestMetadata("multimodule.kt")
public void testMultimodule() throws Exception {
runTest("compiler/testData/codegen/box/funInterface/multimodule.kt");
@@ -11276,6 +11276,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/funInterface/kt46512_indyFunInterfaceOverCallableReference.kt");
}
@TestMetadata("kt46908_functionSupertype.kt")
public void testKt46908_functionSupertype() throws Exception {
runTest("compiler/testData/codegen/box/funInterface/kt46908_functionSupertype.kt");
}
@TestMetadata("multimodule.kt")
public void testMultimodule() throws Exception {
runTest("compiler/testData/codegen/box/funInterface/multimodule.kt");
@@ -6640,6 +6640,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/funInterface/kt46512_indyFunInterfaceOverCallableReference.kt");
}
@TestMetadata("kt46908_functionSupertype.kt")
public void testKt46908_functionSupertype() throws Exception {
runTest("compiler/testData/codegen/box/funInterface/kt46908_functionSupertype.kt");
}
@TestMetadata("compiler/testData/codegen/box/funInterface/equality")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)