[FIR2IR] Correct 'this' conversion when it points to non-closest class

This commit is contained in:
Mikhail Glukhikh
2020-03-27 19:16:53 +03:00
parent 4388b30f87
commit a0978a50e8
13 changed files with 26 additions and 19 deletions
@@ -19,7 +19,7 @@ FILE fqName:<root> fileName:/outerClassAccess.kt
$this: VALUE_PARAMETER name:<this> type:<root>.Outer.Inner
BLOCK_BODY
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Outer' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.Outer.Inner declared in <root>.Outer.Inner.test' type=<root>.Outer.Inner origin=null
$this: GET_VAR '<this>: <root>.Outer declared in <root>.Outer' type=<root>.Outer origin=null
CLASS CLASS name:Inner2 modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Outer.Inner.Inner2
CONSTRUCTOR visibility:public <> ($this:<root>.Outer.Inner.Inner2) returnType:<root>.Outer.Inner.Inner2 [primary]
@@ -31,9 +31,9 @@ FILE fqName:<root> fileName:/outerClassAccess.kt
$this: VALUE_PARAMETER name:<this> type:<root>.Outer.Inner.Inner2
BLOCK_BODY
CALL 'public final fun test (): kotlin.Unit declared in <root>.Outer.Inner' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.Outer.Inner.Inner2 declared in <root>.Outer.Inner.Inner2.test2' type=<root>.Outer.Inner.Inner2 origin=null
$this: GET_VAR '<this>: <root>.Outer.Inner declared in <root>.Outer.Inner' type=<root>.Outer.Inner origin=null
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Outer' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.Outer.Inner.Inner2 declared in <root>.Outer.Inner.Inner2.test2' type=<root>.Outer.Inner.Inner2 origin=null
$this: GET_VAR '<this>: <root>.Outer declared in <root>.Outer' type=<root>.Outer origin=null
FUN name:test3 visibility:public modality:FINAL <> ($this:<root>.Outer.Inner.Inner2, $receiver:<root>.Outer) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Outer.Inner.Inner2
$receiver: VALUE_PARAMETER name:<this> type:<root>.Outer
@@ -86,7 +86,7 @@ FILE fqName:<root> fileName:/multipleThisReferences.kt
EXPRESSION_BODY
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS
$this: CALL 'public final fun <get-x> (): kotlin.Int declared in <root>.Outer.Inner' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Host declared in <root>.Host.test' type=<root>.Host origin=null
$this: GET_VAR '<this>: <root>.Host.test.<no name provided> declared in <root>.Host.test.<no name provided>' type=<root>.Host.test.<no name provided> origin=null
other: CALL 'public final fun <get-y> (): kotlin.Int declared in <root>.Host' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Host declared in <root>.Host.test' type=<root>.Host origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-xx> visibility:public modality:FINAL <> ($this:<root>.Host.test.<no name provided>) returnType:kotlin.Int
@@ -20,7 +20,7 @@ FILE fqName:<root> fileName:/outerClassInstanceReference.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun inner (): kotlin.Unit declared in <root>.Outer.Inner'
CALL 'public final fun outer (): kotlin.Unit declared in <root>.Outer' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.Outer.Inner declared in <root>.Outer.Inner.inner' type=<root>.Outer.Inner origin=null
$this: GET_VAR '<this>: <root>.Outer declared in <root>.Outer' type=<root>.Outer origin=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