[fir2ir] Fix field-receiver extracting for evaluator

KT-61144
This commit is contained in:
Alexey Merkulov
2023-07-27 13:51:44 +02:00
committed by Space Team
parent c520aeb5aa
commit 35eca56d32
14 changed files with 121 additions and 8 deletions
@@ -0,0 +1,4 @@
ContainingClass[name: <this>; isMutated: false; displayText: this@Test]
context(R|Ctx1|, R|Ctx2|)
class Test : R|kotlin/Any|
R|Test|
@@ -0,0 +1,14 @@
MODULE_FRAGMENT name:<Sources of main>
FILE fqName:<root> fileName:/fragment.kt
CLASS CLASS name:CodeFragment modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.CodeFragment
CONSTRUCTOR visibility:public <> () returnType:<root>.CodeFragment [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
FUN name:run visibility:public modality:FINAL <> (p0:<root>.Test) returnType:kotlin.Int
VALUE_PARAMETER name:p0 index:0 type:<root>.Test
EXPRESSION_BODY
BLOCK type=kotlin.Int origin=null
CALL 'public final fun useWithCtx2 ($context_receiver_0: <root>.Ctx2): kotlin.Int declared in <root>.SecondClassContextReceiverKt' type=kotlin.Int origin=null
$context_receiver_0: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField1 type:<root>.Ctx2 visibility:private [final]' type=<root>.Ctx2 origin=null
receiver: GET_VAR 'p0: <root>.Test declared in <root>.CodeFragment.run' type=<root>.Test origin=null
@@ -0,0 +1,13 @@
// !LANGUAGE: +ContextReceivers
class Ctx1
class Ctx2
context(Ctx2)
fun useWithCtx2() = 3
context(Ctx1, Ctx2)
class Test {
fun foo() {
<caret>val x = 1
}
}
@@ -0,0 +1,5 @@
public final class CodeFragment {
// source: 'fragment.kt'
public method <init>(): void
public final static method run(p0: Test): int
}
@@ -0,0 +1,4 @@
ContainingClass[name: <this>; isMutated: false; displayText: this@Test]
context(R|Ctx1|)
class Test : R|kotlin/Any|
R|Test|
@@ -0,0 +1,14 @@
MODULE_FRAGMENT name:<Sources of main>
FILE fqName:<root> fileName:/fragment.kt
CLASS CLASS name:CodeFragment modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.CodeFragment
CONSTRUCTOR visibility:public <> () returnType:<root>.CodeFragment [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
FUN name:run visibility:public modality:FINAL <> (p0:<root>.Test) returnType:kotlin.Int
VALUE_PARAMETER name:p0 index:0 type:<root>.Test
EXPRESSION_BODY
BLOCK type=kotlin.Int origin=null
CALL 'public final fun useWithCtx1 ($context_receiver_0: <root>.Ctx1): kotlin.Int declared in <root>.SingleClassContextReceiverKt' type=kotlin.Int origin=null
$context_receiver_0: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:<root>.Ctx1 visibility:private [final]' type=<root>.Ctx1 origin=null
receiver: GET_VAR 'p0: <root>.Test declared in <root>.CodeFragment.run' type=<root>.Test origin=null
@@ -0,0 +1,12 @@
// !LANGUAGE: +ContextReceivers
class Ctx1
context(Ctx1)
fun useWithCtx1() = 3
context(Ctx1)
class Test {
fun foo() {
<caret>val x = 1
}
}
@@ -0,0 +1,5 @@
public final class CodeFragment {
// source: 'fragment.kt'
public method <init>(): void
public final static method run(p0: Test): int
}