From 50f610cfd894c484a2f41bf6aa183c7830df65ec Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Mon, 6 Dec 2021 14:50:05 +0300 Subject: [PATCH] [Test] Add forgotten dumps for Fir2Ir text tests --- .../typeParameterAsContextReceiver.fir.ir.txt | 24 +++++++++++++++++++ .../typeParameterAsContextReceiver.fir.kt.txt | 12 ++++++++++ .../typeParameterAsContextReceiver.kt | 3 +-- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.fir.ir.txt create mode 100644 compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.fir.kt.txt diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.fir.ir.txt new file mode 100644 index 00000000000..2e11ebc5d4d --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.fir.ir.txt @@ -0,0 +1,24 @@ +FILE fqName: fileName:/typeParameterAsContextReceiver.kt + FUN name:useContext visibility:public modality:FINAL (block:kotlin.Function1.useContext, kotlin.Unit>) returnType:kotlin.Unit + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + VALUE_PARAMETER name:block index:0 type:kotlin.Function1.useContext, kotlin.Unit> + BLOCK_BODY + FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun with (receiver: T of kotlin.StandardKt.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.StandardKt.with [inline] declared in kotlin.StandardKt' type=kotlin.Unit origin=null + : kotlin.Int + : kotlin.Unit + receiver: CONST Int type=kotlin.Int value=42 + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Unit + $receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int + BLOCK_BODY + CALL 'public final fun useContext (block: kotlin.Function1.useContext, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + : kotlin.Int + block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (i:kotlin.Int) returnType:kotlin.Unit + VALUE_PARAMETER name:i index:0 type:kotlin.Int + BLOCK_BODY + TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + CALL 'public open fun toDouble (): kotlin.Double declared in kotlin.Int' type=kotlin.Double origin=null + $this: GET_VAR 'i: kotlin.Int declared in .test..' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.fir.kt.txt new file mode 100644 index 00000000000..25114176766 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.fir.kt.txt @@ -0,0 +1,12 @@ +fun useContext(block: Function1) { +} + +fun test() { + with(receiver = 42, block = local fun Int.() { + useContext(block = local fun (i: Int) { + i.toDouble() /*~> Unit */ + } +) + } +) +} diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt index 924e2bef55e..06cb23919c0 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ContextReceivers -// IGNORE_BACKEND_FIR: JVM_IR context(T) fun useContext(block: (T) -> Unit) { } @@ -8,4 +7,4 @@ fun test() { with(42) { useContext { i: Int -> i.toDouble() } } -} \ No newline at end of file +}