[FIR] resolve delegate field return type in correct scope

We should resolve it in the same way as delegate constructor call
to avoid access to nested class scopes

^KT-63522 Fixed
^KT-63042
This commit is contained in:
Dmitrii Gridin
2023-11-16 17:51:16 +01:00
committed by Space Team
parent ab6b3a6047
commit 0b253dc815
31 changed files with 362 additions and 231 deletions
@@ -69,6 +69,15 @@ FILE fqName:second fileName:/nestedNameClash2.kt
RETURN type=kotlin.Nothing from='public final fun <get-prop> (): second.Base declared in second.MyClass'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base visibility:private [final]' type=second.Base origin=null
receiver: GET_VAR '<this>: second.MyClass declared in second.MyClass.<get-prop>' type=second.MyClass origin=null
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:second.MyClass) returnType:kotlin.String
overridden:
public open fun foo (): kotlin.String declared in second.Base
$this: VALUE_PARAMETER name:<this> type:second.MyClass
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in second.MyClass'
CALL 'public open fun foo (): kotlin.String declared in second.Base' type=kotlin.String origin=null
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop type:second.Base visibility:private [final]' type=second.Base origin=null
receiver: GET_VAR '<this>: second.MyClass declared in second.MyClass.foo' type=second.MyClass origin=null
CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:second.MyClass.Base
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
@@ -97,7 +106,3 @@ FILE fqName:second fileName:/nestedNameClash2.kt
overridden:
public open fun toString (): kotlin.String declared in second.Base
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:second.Base) returnType:kotlin.String [fake_override]
overridden:
public open fun foo (): kotlin.String declared in second.Base
$this: VALUE_PARAMETER name:<this> type:second.Base