[FIR2IR] Unwrap typealiases during applying of suspend conversion
^KT-65002 Fixed
This commit is contained in:
committed by
Space Team
parent
83ddf904aa
commit
9857bdc891
+6
@@ -53232,6 +53232,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
+6
@@ -53232,6 +53232,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
+2
-1
@@ -18,6 +18,7 @@ import org.jetbrains.kotlin.fir.render
|
||||
import org.jetbrains.kotlin.fir.resolve.FirSamResolver
|
||||
import org.jetbrains.kotlin.fir.resolve.calls.FirFakeArgumentForCallableReference
|
||||
import org.jetbrains.kotlin.fir.resolve.calls.ResolvedCallArgument
|
||||
import org.jetbrains.kotlin.fir.resolve.fullyExpandedType
|
||||
import org.jetbrains.kotlin.fir.resolve.substitution.AbstractConeSubstitutor
|
||||
import org.jetbrains.kotlin.fir.resolve.toFirRegularClassSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterLookupTag
|
||||
@@ -603,7 +604,7 @@ internal class AdapterGenerator(
|
||||
expectedFunctionalType: ConeClassLikeType,
|
||||
argument: FirExpression
|
||||
): IrSimpleFunctionSymbol? {
|
||||
val argumentType = ((argument as? FirSamConversionExpression)?.expression ?: argument).resolvedType
|
||||
val argumentType = ((argument as? FirSamConversionExpression)?.expression ?: argument).resolvedType.fullyExpandedType(session)
|
||||
val argumentTypeWithInvoke = argumentType.findSubtypeOfBasicFunctionType(session, expectedFunctionalType) ?: return null
|
||||
|
||||
return if (argumentTypeWithInvoke.isSomeFunctionType(session)) {
|
||||
|
||||
+6
@@ -52915,6 +52915,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
+6
@@ -52915,6 +52915,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
+6
@@ -52973,6 +52973,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// DONT_TARGET_EXACT_BACKEND: JVM
|
||||
// ISSUE: KT-65002
|
||||
typealias Listener = (String) -> Unit
|
||||
|
||||
fun foo(f: suspend (String) -> Unit): String = "OK"
|
||||
|
||||
fun box(): String {
|
||||
val f: Listener = {}
|
||||
return foo(f)
|
||||
}
|
||||
+6
@@ -52283,6 +52283,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
+6
@@ -52283,6 +52283,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
+6
@@ -52283,6 +52283,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
+6
@@ -52225,6 +52225,12 @@ public class FirBlackBoxCodegenTestWithInlineScopesGenerated extends AbstractFir
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
+5
@@ -42131,6 +42131,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOnVarargElements.kt");
|
||||
|
||||
+6
@@ -36791,6 +36791,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
Generated
+6
@@ -36791,6 +36791,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
+6
@@ -36227,6 +36227,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
+6
@@ -36227,6 +36227,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
+6
@@ -40138,6 +40138,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
+6
@@ -41158,6 +41158,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
+6
@@ -38542,6 +38542,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
+6
@@ -39551,6 +39551,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
Generated
+6
@@ -36683,6 +36683,12 @@ public class FirWasmJsCodegenBoxTestGenerated extends AbstractFirWasmJsCodegenBo
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
Generated
+6
@@ -36119,6 +36119,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOfAliasedType.kt")
|
||||
public void testSuspendConversionOfAliasedType() {
|
||||
runTest("compiler/testData/codegen/box/suspendConversion/suspendConversionOfAliasedType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("suspendConversionOnVarargElements.kt")
|
||||
public void testSuspendConversionOnVarargElements() {
|
||||
|
||||
Reference in New Issue
Block a user