[FIR] Unwrap captured types in target type of SAM conversion

^KT-66256 Fixed
This commit is contained in:
Dmitriy Novozhilov
2024-03-01 14:06:27 +02:00
committed by Space Team
parent 690f39b91c
commit b875ae774e
28 changed files with 185 additions and 26 deletions
@@ -549,7 +549,7 @@ internal class AdapterGenerator(
}
internal fun getFunctionTypeForPossibleSamType(parameterType: ConeKotlinType): ConeKotlinType? {
return samResolver.getFunctionTypeForPossibleSamType(parameterType)
return samResolver.getSamInfoForPossibleSamType(parameterType)?.functionalType
}
/**
@@ -53661,6 +53661,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
runTest("compiler/testData/codegen/box/sam/fieldInJavaSamInterface.kt");
}
@Test
@TestMetadata("inProjectedSam.kt")
public void testInProjectedSam() {
runTest("compiler/testData/codegen/box/sam/inProjectedSam.kt");
}
@Test
@TestMetadata("inlinedSamWrapper.kt")
public void testInlinedSamWrapper() {
@@ -53661,6 +53661,12 @@ public class FirLightTreeBlackBoxCodegenWithFir2IrFakeOverrideGeneratorTestGener
runTest("compiler/testData/codegen/box/sam/fieldInJavaSamInterface.kt");
}
@Test
@TestMetadata("inProjectedSam.kt")
public void testInProjectedSam() {
runTest("compiler/testData/codegen/box/sam/inProjectedSam.kt");
}
@Test
@TestMetadata("inlinedSamWrapper.kt")
public void testInlinedSamWrapper() {
@@ -53661,6 +53661,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
runTest("compiler/testData/codegen/box/sam/fieldInJavaSamInterface.kt");
}
@Test
@TestMetadata("inProjectedSam.kt")
public void testInProjectedSam() {
runTest("compiler/testData/codegen/box/sam/inProjectedSam.kt");
}
@Test
@TestMetadata("inlinedSamWrapper.kt")
public void testInlinedSamWrapper() {