[FIR2IR] Fix generation of val initialization after smart-cast

If neither setter nor backing field were found for an assignment call,
search overridden properties for backing fields.

^KT-57105 Fixed
This commit is contained in:
Kirill Rakhman
2023-03-07 11:16:44 +01:00
committed by Space Team
parent 2706e5502f
commit 0e721c8fc2
16 changed files with 99 additions and 3 deletions
@@ -46,7 +46,10 @@ FILE fqName:<root> fileName:/smartCastInValInitialization.kt
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
TYPE_OP type=<root>.RootBus origin=CAST typeOperand=<root>.RootBus
GET_VAR '<this>: <root>.MessageBusImpl declared in <root>.MessageBusImpl' type=<root>.MessageBusImpl origin=null
ERROR_CALL 'Unresolved reference: R|/MessageBusImpl.parentBus|' type=IrErrorType(null)
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:parentBus type:kotlin.Any? visibility:private [final]' type=kotlin.Unit origin=null
receiver: TYPE_OP type=<root>.RootBus origin=IMPLICIT_CAST typeOperand=<root>.RootBus
GET_VAR '<this>: <root>.MessageBusImpl declared in <root>.MessageBusImpl' type=<root>.MessageBusImpl origin=null
value: CONST Null type=kotlin.Nothing? value=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
@@ -19,7 +19,7 @@ open class MessageBusImpl {
init {
<this> as RootBus /*~> Unit */
error("") /* ErrorCallExpression */
<this> /*as RootBus */.#parentBus = null
}
}