[FIR2IR] Don't create f/o symbols on smartcasted Nothing in dispatch receiver

^KT-63525 Fixed
This commit is contained in:
Dmitriy Novozhilov
2024-02-27 11:06:01 +02:00
committed by Space Team
parent 62e9c944fe
commit 5c632bc78e
23 changed files with 143 additions and 1 deletions
@@ -277,7 +277,10 @@ fun FirCallableSymbol<*>.toSymbolForCall(
}
// Member fake override or bound callable reference
dispatchReceiver != null -> {
val callSiteDispatchReceiverType = dispatchReceiver.resolvedType
val callSiteDispatchReceiverType = when (dispatchReceiver) {
is FirSmartCastExpression -> dispatchReceiver.smartcastTypeWithoutNullableNothing?.coneType ?: dispatchReceiver.resolvedType
else -> dispatchReceiver.resolvedType
}
val declarationSiteDispatchReceiverType = dispatchReceiverType
val type = if (callSiteDispatchReceiverType is ConeDynamicType && declarationSiteDispatchReceiverType != null) {
declarationSiteDispatchReceiverType
@@ -11907,6 +11907,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
runTest("compiler/testData/codegen/box/controlflow/break1.kt");
}
@Test
@TestMetadata("callOnSmarcastedNothing.kt")
public void testCallOnSmarcastedNothing() {
runTest("compiler/testData/codegen/box/controlflow/callOnSmarcastedNothing.kt");
}
@Test
@TestMetadata("for_loops.kt")
public void testFor_loops() {
@@ -11907,6 +11907,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
runTest("compiler/testData/codegen/box/controlflow/break1.kt");
}
@Test
@TestMetadata("callOnSmarcastedNothing.kt")
public void testCallOnSmarcastedNothing() {
runTest("compiler/testData/codegen/box/controlflow/callOnSmarcastedNothing.kt");
}
@Test
@TestMetadata("for_loops.kt")
public void testFor_loops() {
@@ -11907,6 +11907,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
runTest("compiler/testData/codegen/box/controlflow/break1.kt");
}
@Test
@TestMetadata("callOnSmarcastedNothing.kt")
public void testCallOnSmarcastedNothing() {
runTest("compiler/testData/codegen/box/controlflow/callOnSmarcastedNothing.kt");
}
@Test
@TestMetadata("for_loops.kt")
public void testFor_loops() {