diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassDescriptor.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassDescriptor.java index bedc8112631..e30b8efdf3d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassDescriptor.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassDescriptor.java @@ -59,6 +59,7 @@ import static org.jetbrains.kotlin.descriptors.DescriptorVisibilities.PRIVATE; import static org.jetbrains.kotlin.descriptors.DescriptorVisibilities.PUBLIC; import static org.jetbrains.kotlin.diagnostics.Errors.*; import static org.jetbrains.kotlin.lexer.KtTokens.INNER_KEYWORD; +import static org.jetbrains.kotlin.name.NameUtils.contextReceiverName; import static org.jetbrains.kotlin.resolve.BindingContext.TYPE; import static org.jetbrains.kotlin.resolve.ModifiersChecker.resolveModalityFromModifiers; import static org.jetbrains.kotlin.resolve.ModifiersChecker.resolveVisibilityFromModifiers; @@ -317,7 +318,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes c.getTypeResolver().resolveType(getScopeForClassHeaderResolution(), typeReference, c.getTrace(), true); Name label = contextReceiver.labelNameAsName() != null ? contextReceiver.labelNameAsName() - : Name.identifier("_context_receiver_" + index); + : contextReceiverName(index); return DescriptorFactory.createContextReceiverParameterForClass( this, kotlinType, diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.ir.txt index af57967d6dd..2f87aa07c55 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.ir.txt @@ -111,17 +111,17 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null - FUN name:get visibility:public modality:FINAL <> ($receiver:.MyContainer, _context_receiver_0:kotlin.Int, index:kotlin.Int) returnType:kotlin.Int [operator] + FUN name:get visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, index:kotlin.Int) returnType:kotlin.Int [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.MyContainer - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:index index:1 type:kotlin.Int BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .get' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun get (_context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.Int [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .get' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun get ($context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.Int [operator] declared in ' WHEN type=kotlin.Int origin=IF BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ @@ -132,16 +132,16 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Int type=kotlin.Int value=-1 - FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.MyContainer, _context_receiver_0:kotlin.Int, other:.MyContainer) returnType:kotlin.Unit [operator] + FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, other:.MyContainer) returnType:kotlin.Unit [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.MyContainer - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.MyContainer BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .plusAssign' type=kotlin.Int origin=null + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plusAssign' type=kotlin.Int origin=null CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyContainer' type=kotlin.Unit origin=EQ $this: GET_VAR ': .MyContainer declared in .plusAssign' type=.MyContainer origin=null : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null @@ -149,16 +149,16 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt $this: GET_VAR ': .MyContainer declared in .plusAssign' type=.MyContainer origin=null other: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'other: .MyContainer declared in .plusAssign' type=.MyContainer origin=null - FUN name:inc visibility:public modality:FINAL <> ($receiver:.MyContainer, _context_receiver_0:kotlin.Int) returnType:.MyContainer [operator] + FUN name:inc visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int) returnType:.MyContainer [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.MyContainer - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .inc' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun inc (_context_receiver_0: kotlin.Int): .MyContainer [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .inc' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun inc ($context_receiver_0: kotlin.Int): .MyContainer [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .MyContainer' type=.MyContainer origin=null i: 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 (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY @@ -177,20 +177,20 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt 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 plusAssign (_context_receiver_0: kotlin.Int, other: .MyContainer): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null + CALL 'public final fun plusAssign ($context_receiver_0: kotlin.Int, other: .MyContainer): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR 'var myContainer: .MyContainer [var] declared in .box' type=.MyContainer origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null other: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .MyContainer' type=.MyContainer origin=null - i: CALL 'public final fun get (_context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.Int [operator] declared in ' type=kotlin.Int origin=null + i: CALL 'public final fun get ($context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.Int [operator] declared in ' type=kotlin.Int origin=null $receiver: BLOCK type=.MyContainer origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.MyContainer [val] GET_VAR 'var myContainer: .MyContainer [var] declared in .box' type=.MyContainer origin=null SET_VAR 'var myContainer: .MyContainer [var] declared in .box' type=kotlin.Unit origin=EQ - CALL 'public final fun inc (_context_receiver_0: kotlin.Int): .MyContainer [operator] declared in ' type=.MyContainer origin=null + CALL 'public final fun inc ($context_receiver_0: kotlin.Int): .MyContainer [operator] declared in ' type=.MyContainer origin=null $receiver: GET_VAR 'val tmp_1: .MyContainer [val] declared in .box.' type=.MyContainer origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null GET_VAR 'val tmp_1: .MyContainer [val] declared in .box.' type=.MyContainer origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null index: CONST Int type=kotlin.Int value=0 RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' WHEN type=kotlin.String origin=IF diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.kt.txt index ac577512eb5..dfc516fba4a 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.kt.txt @@ -47,32 +47,32 @@ var operationScore: Int get set -operator fun MyContainer.get(_context_receiver_0: Int, index: Int): Int { - ( = ().plus(other = _context_receiver_0)) +operator fun MyContainer.get($context_receiver_0: Int, index: Int): Int { + ( = ().plus(other = $context_receiver_0)) return when { EQEQ(arg0 = index, arg1 = 0) -> .() else -> -1 } } -operator fun MyContainer.plusAssign(_context_receiver_0: Int, other: MyContainer) { - ( = ().plus(other = _context_receiver_0)) +operator fun MyContainer.plusAssign($context_receiver_0: Int, other: MyContainer) { + ( = ().plus(other = $context_receiver_0)) .( = .().plus(other = other.())) } -operator fun MyContainer.inc(_context_receiver_0: Int): MyContainer { - ( = ().plus(other = _context_receiver_0)) +operator fun MyContainer.inc($context_receiver_0: Int): MyContainer { + ( = ().plus(other = $context_receiver_0)) return MyContainer(i = .().plus(other = 1)) } fun box(): String { var myContainer: MyContainer = MyContainer(i = 0) with(receiver = 1, block = local fun Int.() { - myContainer.plusAssign(_context_receiver_0 = $this$with, other = MyContainer(i = { // BLOCK + myContainer.plusAssign($context_receiver_0 = $this$with, other = MyContainer(i = { // BLOCK val : MyContainer = myContainer - myContainer = .inc(_context_receiver_0 = $this$with) + myContainer = .inc($context_receiver_0 = $this$with) - }.get(_context_receiver_0 = $this$with, index = 0))) + }.get($context_receiver_0 = $this$with, index = 0))) } ) return when { diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.ir.txt index 8301115f022..fda488f7b2f 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.ir.txt @@ -111,18 +111,18 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null - FUN name:get visibility:public modality:FINAL <> ($receiver:.MyContainer, _context_receiver_0:kotlin.Int, index:kotlin.Int) returnType:kotlin.Int [operator] + FUN name:get visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, index:kotlin.Int) returnType:kotlin.Int [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.MyContainer - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:index index:1 type:kotlin.Int BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .get' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun get (_context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.Int [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .get' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun get ($context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.Int [operator] declared in ' WHEN type=kotlin.Int origin=IF BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ @@ -133,17 +133,17 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Int type=kotlin.Int value=-1 - FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.MyContainer, _context_receiver_0:kotlin.Int, other:.MyContainer) returnType:kotlin.Unit [operator] + FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, other:.MyContainer) returnType:kotlin.Unit [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.MyContainer - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.MyContainer BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .plusAssign' type=kotlin.Int origin=null + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plusAssign' type=kotlin.Int origin=null BLOCK type=kotlin.Unit origin=PLUSEQ VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.MyContainer [val] GET_VAR ': .MyContainer declared in .plusAssign' type=.MyContainer origin=null @@ -154,17 +154,17 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt $this: GET_VAR 'val tmp_1: .MyContainer [val] declared in .plusAssign' type=.MyContainer origin=null other: CALL 'public final fun (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'other: .MyContainer declared in .plusAssign' type=.MyContainer origin=null - FUN name:inc visibility:public modality:FINAL <> ($receiver:.MyContainer, _context_receiver_0:kotlin.Int) returnType:.MyContainer [operator] + FUN name:inc visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int) returnType:.MyContainer [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.MyContainer - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .inc' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun inc (_context_receiver_0: kotlin.Int): .MyContainer [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .inc' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun inc ($context_receiver_0: kotlin.Int): .MyContainer [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .MyContainer' type=.MyContainer origin=null i: 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 (): kotlin.Int declared in .MyContainer' type=kotlin.Int origin=GET_PROPERTY @@ -183,20 +183,20 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt 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 plusAssign (_context_receiver_0: kotlin.Int, other: .MyContainer): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun plusAssign ($context_receiver_0: kotlin.Int, other: .MyContainer): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=PLUSEQ $receiver: GET_VAR 'var myContainer: .MyContainer [var] declared in .box' type=.MyContainer origin=PLUSEQ - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null other: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .MyContainer' type=.MyContainer origin=null - i: CALL 'public final fun get (_context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.Int [operator] declared in ' type=kotlin.Int origin=GET_ARRAY_ELEMENT + i: CALL 'public final fun get ($context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.Int [operator] declared in ' type=kotlin.Int origin=GET_ARRAY_ELEMENT $receiver: BLOCK type=.MyContainer origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.MyContainer [val] GET_VAR 'var myContainer: .MyContainer [var] declared in .box' type=.MyContainer origin=POSTFIX_INCR SET_VAR 'var myContainer: .MyContainer [var] declared in .box' type=kotlin.Unit origin=POSTFIX_INCR - CALL 'public final fun inc (_context_receiver_0: kotlin.Int): .MyContainer [operator] declared in ' type=.MyContainer origin=POSTFIX_INCR + CALL 'public final fun inc ($context_receiver_0: kotlin.Int): .MyContainer [operator] declared in ' type=.MyContainer origin=POSTFIX_INCR $receiver: GET_VAR 'val tmp_2: .MyContainer [val] declared in .box.' type=.MyContainer origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null GET_VAR 'val tmp_2: .MyContainer [val] declared in .box.' type=.MyContainer origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null index: CONST Int type=kotlin.Int value=0 RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' WHEN type=kotlin.String origin=IF diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.kt.txt index dc00457268d..2fb4d11922c 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.kt.txt @@ -47,9 +47,9 @@ var operationScore: Int get set -operator fun MyContainer.get(_context_receiver_0: Int, index: Int): Int { +operator fun MyContainer.get($context_receiver_0: Int, index: Int): Int { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } return when { EQEQ(arg0 = index, arg1 = 0) -> .() @@ -57,9 +57,9 @@ operator fun MyContainer.get(_context_receiver_0: Int, index: Int): Int { } } -operator fun MyContainer.plusAssign(_context_receiver_0: Int, other: MyContainer) { +operator fun MyContainer.plusAssign($context_receiver_0: Int, other: MyContainer) { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } { // BLOCK val tmp0_this: MyContainer = @@ -67,9 +67,9 @@ operator fun MyContainer.plusAssign(_context_receiver_0: Int, other: MyContainer } } -operator fun MyContainer.inc(_context_receiver_0: Int): MyContainer { +operator fun MyContainer.inc($context_receiver_0: Int): MyContainer { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } return MyContainer(i = .().plus(other = 1)) } @@ -77,11 +77,11 @@ operator fun MyContainer.inc(_context_receiver_0: Int): MyContainer { fun box(): String { var myContainer: MyContainer = MyContainer(i = 0) with(receiver = 1, block = local fun Int.() { - myContainer.plusAssign(_context_receiver_0 = $this$with, other = MyContainer(i = { // BLOCK + myContainer.plusAssign($context_receiver_0 = $this$with, other = MyContainer(i = { // BLOCK val tmp0: MyContainer = myContainer - myContainer = tmp0.inc(_context_receiver_0 = $this$with) + myContainer = tmp0.inc($context_receiver_0 = $this$with) tmp0 - }.get(_context_receiver_0 = $this$with, index = 0))) + }.get($context_receiver_0 = $this$with, index = 0))) } ) return when { diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.ir.txt index 0d69ad50e9f..d83bced5048 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.ir.txt @@ -96,13 +96,13 @@ FILE fqName: fileName:/arrayAccessOperators.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null receiver: GET_VAR ': .MyContainer declared in .MyContainer.toString' type=.MyContainer origin=null CONST String type=kotlin.String value=")" - FUN name:get visibility:public modality:FINAL <> ($receiver:.MyContainer, _context_receiver_0:kotlin.Int, index:kotlin.Int) returnType:kotlin.String? [operator] + FUN name:get visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, index:kotlin.Int) returnType:kotlin.String? [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.MyContainer - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:index index:1 type:kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun get (_context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.String? [operator] declared in ' + RETURN type=kotlin.Nothing from='public final fun get ($context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.String? [operator] declared in ' WHEN type=kotlin.String? origin=IF BRANCH if: WHEN type=kotlin.Boolean origin=ANDAND @@ -111,7 +111,7 @@ FILE fqName: fileName:/arrayAccessOperators.kt arg0: GET_VAR 'index: kotlin.Int declared in .get' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=0 then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR '_context_receiver_0: kotlin.Int declared in .get' type=kotlin.Int origin=null + arg0: GET_VAR '$context_receiver_0: kotlin.Int declared in .get' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=42 BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -121,10 +121,10 @@ FILE fqName: fileName:/arrayAccessOperators.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Null type=kotlin.Nothing? value=null - FUN name:set visibility:public modality:FINAL <> ($receiver:.MyContainer, _context_receiver_0:kotlin.Int, index:kotlin.Int, value:kotlin.String) returnType:kotlin.Unit [operator] + FUN name:set visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, index:kotlin.Int, value:kotlin.String) returnType:kotlin.Unit [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.MyContainer - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:index index:1 type:kotlin.Int VALUE_PARAMETER name:value index:2 type:kotlin.String BLOCK_BODY @@ -141,9 +141,9 @@ FILE fqName: fileName:/arrayAccessOperators.kt if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR '_context_receiver_0: kotlin.Int declared in .set' type=kotlin.Int origin=null + arg0: GET_VAR '$context_receiver_0: kotlin.Int declared in .set' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=42 - then: RETURN type=kotlin.Nothing from='public final fun set (_context_receiver_0: kotlin.Int, index: kotlin.Int, value: kotlin.String): kotlin.Unit [operator] declared in ' + then: RETURN type=kotlin.Nothing from='public final fun set ($context_receiver_0: kotlin.Int, index: kotlin.Int, value: kotlin.String): kotlin.Unit [operator] declared in ' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .MyContainer' type=kotlin.Unit origin=EQ $this: GET_VAR ': .MyContainer declared in .set' type=.MyContainer origin=null @@ -162,17 +162,17 @@ FILE fqName: fileName:/arrayAccessOperators.kt VAR name:myContainer type:.MyContainer [val] CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) [primary] declared in .MyContainer' type=.MyContainer origin=null s: CONST String type=kotlin.String value="fail" - CALL 'public final fun set (_context_receiver_0: kotlin.Int, index: kotlin.Int, value: kotlin.String): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null + CALL 'public final fun set ($context_receiver_0: kotlin.Int, index: kotlin.Int, value: kotlin.String): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR 'val myContainer: .MyContainer [val] declared in .box.' type=.MyContainer origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null index: CONST Int type=kotlin.Int value=0 value: CONST String type=kotlin.String value="OK" RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' BLOCK type=kotlin.String origin=ELVIS VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val] - CALL 'public final fun get (_context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.String? [operator] declared in ' type=kotlin.String? origin=null + CALL 'public final fun get ($context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.String? [operator] declared in ' type=kotlin.String? origin=null $receiver: GET_VAR 'val myContainer: .MyContainer [val] declared in .box.' type=.MyContainer origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null index: CONST Int type=kotlin.Int value=0 WHEN type=kotlin.String origin=ELVIS BRANCH diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.kt.txt index 9bea508a8eb..32802291b26 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.kt.txt @@ -42,21 +42,21 @@ data class MyContainer { } -operator fun MyContainer.get(_context_receiver_0: Int, index: Int): String? { +operator fun MyContainer.get($context_receiver_0: Int, index: Int): String? { return when { when { - EQEQ(arg0 = index, arg1 = 0) -> EQEQ(arg0 = _context_receiver_0, arg1 = 42) + EQEQ(arg0 = index, arg1 = 0) -> EQEQ(arg0 = $context_receiver_0, arg1 = 42) else -> false } -> .() else -> null } } -operator fun MyContainer.set(_context_receiver_0: Int, index: Int, value: String) { +operator fun MyContainer.set($context_receiver_0: Int, index: Int, value: String) { when { when { EQEQ(arg0 = index, arg1 = 0).not() -> true - else -> EQEQ(arg0 = _context_receiver_0, arg1 = 42).not() + else -> EQEQ(arg0 = $context_receiver_0, arg1 = 42).not() } -> return Unit } .( = value) @@ -65,9 +65,9 @@ operator fun MyContainer.set(_context_receiver_0: Int, index: Int, value: String fun box(): String { return with(receiver = 42, block = local fun Int.(): String { val myContainer: MyContainer = MyContainer(s = "fail") - myContainer.set(_context_receiver_0 = $this$with, index = 0, value = "OK") + myContainer.set($context_receiver_0 = $this$with, index = 0, value = "OK") return { // BLOCK - val : String? = myContainer.get(_context_receiver_0 = $this$with, index = 0) + val : String? = myContainer.get($context_receiver_0 = $this$with, index = 0) when { EQEQ(arg0 = , arg1 = null) -> "fail" else -> diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.ir.txt index aef1d236895..b85f088a3c7 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.ir.txt @@ -96,13 +96,13 @@ FILE fqName: fileName:/arrayAccessOperators.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .MyContainer' CONST Boolean type=kotlin.Boolean value=true - FUN name:get visibility:public modality:FINAL <> ($receiver:.MyContainer, _context_receiver_0:kotlin.Int, index:kotlin.Int) returnType:kotlin.String? [operator] + FUN name:get visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, index:kotlin.Int) returnType:kotlin.String? [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.MyContainer - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:index index:1 type:kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun get (_context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.String? [operator] declared in ' + RETURN type=kotlin.Nothing from='public final fun get ($context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.String? [operator] declared in ' WHEN type=kotlin.String? origin=IF BRANCH if: WHEN type=kotlin.Boolean origin=ANDAND @@ -111,7 +111,7 @@ FILE fqName: fileName:/arrayAccessOperators.kt arg0: GET_VAR 'index: kotlin.Int declared in .get' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=0 then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR '_context_receiver_0: kotlin.Int declared in .get' type=kotlin.Int origin=null + arg0: GET_VAR '$context_receiver_0: kotlin.Int declared in .get' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=42 BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -121,10 +121,10 @@ FILE fqName: fileName:/arrayAccessOperators.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Null type=kotlin.Nothing? value=null - FUN name:set visibility:public modality:FINAL <> ($receiver:.MyContainer, _context_receiver_0:kotlin.Int, index:kotlin.Int, value:kotlin.String) returnType:kotlin.Unit [operator] + FUN name:set visibility:public modality:FINAL <> ($receiver:.MyContainer, $context_receiver_0:kotlin.Int, index:kotlin.Int, value:kotlin.String) returnType:kotlin.Unit [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.MyContainer - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:index index:1 type:kotlin.Int VALUE_PARAMETER name:value index:2 type:kotlin.String BLOCK_BODY @@ -141,9 +141,9 @@ FILE fqName: fileName:/arrayAccessOperators.kt if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR '_context_receiver_0: kotlin.Int declared in .set' type=kotlin.Int origin=null + arg0: GET_VAR '$context_receiver_0: kotlin.Int declared in .set' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=42 - then: RETURN type=kotlin.Nothing from='public final fun set (_context_receiver_0: kotlin.Int, index: kotlin.Int, value: kotlin.String): kotlin.Unit [operator] declared in ' + then: RETURN type=kotlin.Nothing from='public final fun set ($context_receiver_0: kotlin.Int, index: kotlin.Int, value: kotlin.String): kotlin.Unit [operator] declared in ' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .MyContainer' type=kotlin.Unit origin=EQ $this: GET_VAR ': .MyContainer declared in .set' type=.MyContainer origin=null @@ -162,17 +162,17 @@ FILE fqName: fileName:/arrayAccessOperators.kt VAR name:myContainer type:.MyContainer [val] CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) [primary] declared in .MyContainer' type=.MyContainer origin=null s: CONST String type=kotlin.String value="fail" - CALL 'public final fun set (_context_receiver_0: kotlin.Int, index: kotlin.Int, value: kotlin.String): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=EQ + CALL 'public final fun set ($context_receiver_0: kotlin.Int, index: kotlin.Int, value: kotlin.String): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=EQ $receiver: GET_VAR 'val myContainer: .MyContainer [val] declared in .box.' type=.MyContainer origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null index: CONST Int type=kotlin.Int value=0 value: CONST String type=kotlin.String value="OK" RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' BLOCK type=kotlin.String origin=ELVIS VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val] - CALL 'public final fun get (_context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.String? [operator] declared in ' type=kotlin.String? origin=GET_ARRAY_ELEMENT + CALL 'public final fun get ($context_receiver_0: kotlin.Int, index: kotlin.Int): kotlin.String? [operator] declared in ' type=kotlin.String? origin=GET_ARRAY_ELEMENT $receiver: GET_VAR 'val myContainer: .MyContainer [val] declared in .box.' type=.MyContainer origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null index: CONST Int type=kotlin.Int value=0 WHEN type=kotlin.String origin=null BRANCH diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.kt.txt index 04940716722..369be3ad65d 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.kt.txt @@ -42,21 +42,21 @@ data class MyContainer { } -operator fun MyContainer.get(_context_receiver_0: Int, index: Int): String? { +operator fun MyContainer.get($context_receiver_0: Int, index: Int): String? { return when { when { - EQEQ(arg0 = index, arg1 = 0) -> EQEQ(arg0 = _context_receiver_0, arg1 = 42) + EQEQ(arg0 = index, arg1 = 0) -> EQEQ(arg0 = $context_receiver_0, arg1 = 42) else -> false } -> .() else -> null } } -operator fun MyContainer.set(_context_receiver_0: Int, index: Int, value: String) { +operator fun MyContainer.set($context_receiver_0: Int, index: Int, value: String) { when { when { EQEQ(arg0 = index, arg1 = 0).not() -> true - else -> EQEQ(arg0 = _context_receiver_0, arg1 = 42).not() + else -> EQEQ(arg0 = $context_receiver_0, arg1 = 42).not() } -> return Unit } .( = value) @@ -65,9 +65,9 @@ operator fun MyContainer.set(_context_receiver_0: Int, index: Int, value: String fun box(): String { return with(receiver = 42, block = local fun Int.(): String { val myContainer: MyContainer = MyContainer(s = "fail") - myContainer.set(_context_receiver_0 = $this$with, index = 0, value = "OK") + myContainer.set($context_receiver_0 = $this$with, index = 0, value = "OK") return { // BLOCK - val tmp0_elvis_lhs: String? = myContainer.get(_context_receiver_0 = $this$with, index = 0) + val tmp0_elvis_lhs: String? = myContainer.get($context_receiver_0 = $this$with, index = 0) when { EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> "fail" else -> tmp0_elvis_lhs diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/class.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/class.ir.txt index 26252740552..d4124773717 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/class.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/class.ir.txt @@ -32,14 +32,14 @@ FILE fqName: fileName:/class.kt CLASS CLASS name:Inner modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Inner FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.Outer visibility:private [final] - CONSTRUCTOR visibility:public <> (_context_receiver_0:.Outer, arg:kotlin.Any) returnType:.Inner [primary] - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Outer + CONSTRUCTOR visibility:public <> ($context_receiver_0:.Outer, arg:kotlin.Any) returnType:.Inner [primary] + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Outer VALUE_PARAMETER name:arg index:1 type:kotlin.Any BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.Outer visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .Inner declared in .Inner' type=.Inner origin=null - value: GET_VAR '_context_receiver_0: .Outer declared in .Inner.' type=.Outer origin=null + value: GET_VAR '$context_receiver_0: .Outer declared in .Inner.' type=.Outer origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public superTypes:[kotlin.Any]' FUN name:bar visibility:public modality:FINAL <> ($this:.Inner) returnType:kotlin.Int $this: VALUE_PARAMETER name: type:.Inner @@ -74,6 +74,6 @@ FILE fqName: fileName:/class.kt $receiver: VALUE_PARAMETER name:$this$with type:.Outer BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): .Inner declared in .f' - CONSTRUCTOR_CALL 'public constructor (_context_receiver_0: .Outer, arg: kotlin.Any) [primary] declared in .Inner' type=.Inner origin=null - _context_receiver_0: GET_VAR '$this$with: .Outer declared in .f.' type=.Outer origin=null + CONSTRUCTOR_CALL 'public constructor ($context_receiver_0: .Outer, arg: kotlin.Any) [primary] declared in .Inner' type=.Inner origin=null + $context_receiver_0: GET_VAR '$this$with: .Outer declared in .f.' type=.Outer origin=null arg: CONST Int type=kotlin.Int value=3 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/class.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/class.kt.txt index af6f865267a..e34d8bde129 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/class.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/class.kt.txt @@ -13,9 +13,9 @@ class Outer { class Inner { private /* final field */ val contextReceiverField0: Outer - constructor(_context_receiver_0: Outer, arg: Any) /* primary */ { + constructor($context_receiver_0: Outer, arg: Any) /* primary */ { super/*Any*/() - .#contextReceiverField0 = _context_receiver_0 + .#contextReceiverField0 = $context_receiver_0 /* () */ } @@ -28,7 +28,7 @@ class Inner { fun f(outer: Outer) { with(receiver = outer, block = local fun Outer.(): Inner { - return Inner(_context_receiver_0 = $this$with, arg = 3) + return Inner($context_receiver_0 = $this$with, arg = 3) } ) /*~> Unit */ } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.ir.txt index 1859365533c..54f69c9befd 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.ir.txt @@ -111,33 +111,33 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null - FUN name:plus visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] + FUN name:plus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.Result BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .plus' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun plus (_context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plus' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun plus ($context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: 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 (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Result declared in .plus' type=.Result origin=null other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'other: .Result declared in .plus' type=.Result origin=null - FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] + FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.Result BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .plusAssign' type=kotlin.Int origin=null + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plusAssign' type=kotlin.Int origin=null CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=EQ $this: GET_VAR ': .Result declared in .plusAssign' type=.Result origin=null : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null @@ -145,33 +145,33 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt $this: GET_VAR ': .Result declared in .plusAssign' type=.Result origin=null other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'other: .Result declared in .plusAssign' type=.Result origin=null - FUN name:minus visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] + FUN name:minus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.Result BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .minus' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun minus (_context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .minus' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun minus ($context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MINUS $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Result declared in .minus' type=.Result origin=null other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'other: .Result declared in .minus' type=.Result origin=null - FUN name:minusAssign visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] + FUN name:minusAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.Result BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .minusAssign' type=kotlin.Int origin=null + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .minusAssign' type=kotlin.Int origin=null CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=EQ $this: GET_VAR ': .Result declared in .minusAssign' type=.Result origin=null : CALL 'public final fun minus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null @@ -179,33 +179,33 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt $this: GET_VAR ': .Result declared in .minusAssign' type=.Result origin=null other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'other: .Result declared in .minusAssign' type=.Result origin=null - FUN name:times visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] + FUN name:times visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.Result BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .times' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun times (_context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .times' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun times ($context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MUL $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Result declared in .times' type=.Result origin=null other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'other: .Result declared in .times' type=.Result origin=null - FUN name:timesAssign visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] + FUN name:timesAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.Result BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .timesAssign' type=kotlin.Int origin=null + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .timesAssign' type=kotlin.Int origin=null CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=EQ $this: GET_VAR ': .Result declared in .timesAssign' type=.Result origin=null : CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null @@ -213,33 +213,33 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt $this: GET_VAR ': .Result declared in .timesAssign' type=.Result origin=null other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'other: .Result declared in .timesAssign' type=.Result origin=null - FUN name:div visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] + FUN name:div visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.Result BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .div' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun div (_context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .div' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun div ($context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CALL 'public final fun div (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=DIV $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Result declared in .div' type=.Result origin=null other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'other: .Result declared in .div' type=.Result origin=null - FUN name:divAssign visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] + FUN name:divAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.Result BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .divAssign' type=kotlin.Int origin=null + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .divAssign' type=kotlin.Int origin=null CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Result' type=kotlin.Unit origin=EQ $this: GET_VAR ': .Result declared in .divAssign' type=.Result origin=null : CALL 'public final fun div (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null @@ -260,40 +260,40 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt 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 plusAssign (_context_receiver_0: kotlin.Int, other: .Result): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null + CALL 'public final fun plusAssign ($context_receiver_0: kotlin.Int, other: .Result): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR 'val result: .Result [val] declared in .box' type=.Result origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null - other: CALL 'public final fun plus (_context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' type=.Result origin=PLUS + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + other: CALL 'public final fun plus ($context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' type=.Result origin=PLUS $receiver: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CONST Int type=kotlin.Int value=1 - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null other: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CONST Int type=kotlin.Int value=1 - CALL 'public final fun minusAssign (_context_receiver_0: kotlin.Int, other: .Result): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null + CALL 'public final fun minusAssign ($context_receiver_0: kotlin.Int, other: .Result): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR 'val result: .Result [val] declared in .box' type=.Result origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null - other: CALL 'public final fun minus (_context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' type=.Result origin=MINUS + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + other: CALL 'public final fun minus ($context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' type=.Result origin=MINUS $receiver: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CONST Int type=kotlin.Int value=1 - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null other: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CONST Int type=kotlin.Int value=0 - CALL 'public final fun timesAssign (_context_receiver_0: kotlin.Int, other: .Result): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null + CALL 'public final fun timesAssign ($context_receiver_0: kotlin.Int, other: .Result): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR 'val result: .Result [val] declared in .box' type=.Result origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null - other: CALL 'public final fun times (_context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' type=.Result origin=MUL + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + other: CALL 'public final fun times ($context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' type=.Result origin=MUL $receiver: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CONST Int type=kotlin.Int value=1 - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null other: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CONST Int type=kotlin.Int value=2 - CALL 'public final fun divAssign (_context_receiver_0: kotlin.Int, other: .Result): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null + CALL 'public final fun divAssign ($context_receiver_0: kotlin.Int, other: .Result): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR 'val result: .Result [val] declared in .box' type=.Result origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null - other: CALL 'public final fun div (_context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' type=.Result origin=DIV + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + other: CALL 'public final fun div ($context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' type=.Result origin=DIV $receiver: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CONST Int type=kotlin.Int value=4 - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null other: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CONST Int type=kotlin.Int value=2 RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.kt.txt index 8218f247d28..f0bc1234e62 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.kt.txt @@ -47,53 +47,53 @@ var operationScore: Int get set -operator fun Result.plus(_context_receiver_0: Int, other: Result): Result { - ( = ().plus(other = _context_receiver_0)) +operator fun Result.plus($context_receiver_0: Int, other: Result): Result { + ( = ().plus(other = $context_receiver_0)) return Result(i = .().plus(other = other.())) } -operator fun Result.plusAssign(_context_receiver_0: Int, other: Result) { - ( = ().plus(other = _context_receiver_0)) +operator fun Result.plusAssign($context_receiver_0: Int, other: Result) { + ( = ().plus(other = $context_receiver_0)) .( = .().plus(other = other.())) } -operator fun Result.minus(_context_receiver_0: Int, other: Result): Result { - ( = ().plus(other = _context_receiver_0)) +operator fun Result.minus($context_receiver_0: Int, other: Result): Result { + ( = ().plus(other = $context_receiver_0)) return Result(i = .().minus(other = other.())) } -operator fun Result.minusAssign(_context_receiver_0: Int, other: Result) { - ( = ().plus(other = _context_receiver_0)) +operator fun Result.minusAssign($context_receiver_0: Int, other: Result) { + ( = ().plus(other = $context_receiver_0)) .( = .().minus(other = other.())) } -operator fun Result.times(_context_receiver_0: Int, other: Result): Result { - ( = ().plus(other = _context_receiver_0)) +operator fun Result.times($context_receiver_0: Int, other: Result): Result { + ( = ().plus(other = $context_receiver_0)) return Result(i = .().times(other = other.())) } -operator fun Result.timesAssign(_context_receiver_0: Int, other: Result) { - ( = ().plus(other = _context_receiver_0)) +operator fun Result.timesAssign($context_receiver_0: Int, other: Result) { + ( = ().plus(other = $context_receiver_0)) .( = .().times(other = other.())) } -operator fun Result.div(_context_receiver_0: Int, other: Result): Result { - ( = ().plus(other = _context_receiver_0)) +operator fun Result.div($context_receiver_0: Int, other: Result): Result { + ( = ().plus(other = $context_receiver_0)) return Result(i = .().div(other = other.())) } -operator fun Result.divAssign(_context_receiver_0: Int, other: Result) { - ( = ().plus(other = _context_receiver_0)) +operator fun Result.divAssign($context_receiver_0: Int, other: Result) { + ( = ().plus(other = $context_receiver_0)) .( = .().div(other = other.())) } fun box(): String { val result: Result = Result(i = 0) with(receiver = 1, block = local fun Int.() { - result.plusAssign(_context_receiver_0 = $this$with, other = Result(i = 1).plus(_context_receiver_0 = $this$with, other = Result(i = 1))) - result.minusAssign(_context_receiver_0 = $this$with, other = Result(i = 1).minus(_context_receiver_0 = $this$with, other = Result(i = 0))) - result.timesAssign(_context_receiver_0 = $this$with, other = Result(i = 1).times(_context_receiver_0 = $this$with, other = Result(i = 2))) - result.divAssign(_context_receiver_0 = $this$with, other = Result(i = 4).div(_context_receiver_0 = $this$with, other = Result(i = 2))) + result.plusAssign($context_receiver_0 = $this$with, other = Result(i = 1).plus($context_receiver_0 = $this$with, other = Result(i = 1))) + result.minusAssign($context_receiver_0 = $this$with, other = Result(i = 1).minus($context_receiver_0 = $this$with, other = Result(i = 0))) + result.timesAssign($context_receiver_0 = $this$with, other = Result(i = 1).times($context_receiver_0 = $this$with, other = Result(i = 2))) + result.divAssign($context_receiver_0 = $this$with, other = Result(i = 4).div($context_receiver_0 = $this$with, other = Result(i = 2))) } ) return when { diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.ir.txt index 2cded937ab7..3b48b7a365b 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.ir.txt @@ -111,35 +111,35 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null - FUN name:plus visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] + FUN name:plus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.Result BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .plus' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun plus (_context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plus' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun plus ($context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: 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 (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Result declared in .plus' type=.Result origin=null other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'other: .Result declared in .plus' type=.Result origin=null - FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] + FUN name:plusAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.Result BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .plusAssign' type=kotlin.Int origin=null + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .plusAssign' type=kotlin.Int origin=null BLOCK type=kotlin.Unit origin=PLUSEQ VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.Result [val] GET_VAR ': .Result declared in .plusAssign' type=.Result origin=null @@ -150,35 +150,35 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt $this: GET_VAR 'val tmp_1: .Result [val] declared in .plusAssign' type=.Result origin=null other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'other: .Result declared in .plusAssign' type=.Result origin=null - FUN name:minus visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] + FUN name:minus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.Result BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .minus' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun minus (_context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .minus' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun minus ($context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MINUS $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Result declared in .minus' type=.Result origin=null other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'other: .Result declared in .minus' type=.Result origin=null - FUN name:minusAssign visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] + FUN name:minusAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.Result BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .minusAssign' type=kotlin.Int origin=null + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .minusAssign' type=kotlin.Int origin=null BLOCK type=kotlin.Unit origin=MINUSEQ VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.Result [val] GET_VAR ': .Result declared in .minusAssign' type=.Result origin=null @@ -189,35 +189,35 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt $this: GET_VAR 'val tmp_2: .Result [val] declared in .minusAssign' type=.Result origin=null other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'other: .Result declared in .minusAssign' type=.Result origin=null - FUN name:times visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] + FUN name:times visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.Result BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .times' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun times (_context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .times' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun times ($context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MUL $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Result declared in .times' type=.Result origin=null other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'other: .Result declared in .times' type=.Result origin=null - FUN name:timesAssign visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] + FUN name:timesAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.Result BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .timesAssign' type=kotlin.Int origin=null + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .timesAssign' type=kotlin.Int origin=null BLOCK type=kotlin.Unit origin=MULTEQ VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.Result [val] GET_VAR ': .Result declared in .timesAssign' type=.Result origin=null @@ -228,35 +228,35 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt $this: GET_VAR 'val tmp_3: .Result [val] declared in .timesAssign' type=.Result origin=null other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'other: .Result declared in .timesAssign' type=.Result origin=null - FUN name:div visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] + FUN name:div visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:.Result [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.Result BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .div' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun div (_context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .div' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun div ($context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CALL 'public final fun div (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=DIV $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Result declared in .div' type=.Result origin=null other: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'other: .Result declared in .div' type=.Result origin=null - FUN name:divAssign visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] + FUN name:divAssign visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int, other:.Result) returnType:kotlin.Unit [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:other index:1 type:.Result BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .divAssign' type=kotlin.Int origin=null + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .divAssign' type=kotlin.Int origin=null BLOCK type=kotlin.Unit origin=DIVEQ VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.Result [val] GET_VAR ': .Result declared in .divAssign' type=.Result origin=null @@ -280,40 +280,40 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt 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 plusAssign (_context_receiver_0: kotlin.Int, other: .Result): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=PLUSEQ + CALL 'public final fun plusAssign ($context_receiver_0: kotlin.Int, other: .Result): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=PLUSEQ $receiver: GET_VAR 'val result: .Result [val] declared in .box' type=.Result origin=PLUSEQ - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null - other: CALL 'public final fun plus (_context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' type=.Result origin=PLUS + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + other: CALL 'public final fun plus ($context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' type=.Result origin=PLUS $receiver: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CONST Int type=kotlin.Int value=1 - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null other: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CONST Int type=kotlin.Int value=1 - CALL 'public final fun minusAssign (_context_receiver_0: kotlin.Int, other: .Result): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=MINUSEQ + CALL 'public final fun minusAssign ($context_receiver_0: kotlin.Int, other: .Result): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=MINUSEQ $receiver: GET_VAR 'val result: .Result [val] declared in .box' type=.Result origin=MINUSEQ - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null - other: CALL 'public final fun minus (_context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' type=.Result origin=MINUS + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + other: CALL 'public final fun minus ($context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' type=.Result origin=MINUS $receiver: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CONST Int type=kotlin.Int value=1 - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null other: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CONST Int type=kotlin.Int value=0 - CALL 'public final fun timesAssign (_context_receiver_0: kotlin.Int, other: .Result): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=MULTEQ + CALL 'public final fun timesAssign ($context_receiver_0: kotlin.Int, other: .Result): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=MULTEQ $receiver: GET_VAR 'val result: .Result [val] declared in .box' type=.Result origin=MULTEQ - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null - other: CALL 'public final fun times (_context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' type=.Result origin=MUL + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + other: CALL 'public final fun times ($context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' type=.Result origin=MUL $receiver: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CONST Int type=kotlin.Int value=1 - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null other: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CONST Int type=kotlin.Int value=2 - CALL 'public final fun divAssign (_context_receiver_0: kotlin.Int, other: .Result): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=DIVEQ + CALL 'public final fun divAssign ($context_receiver_0: kotlin.Int, other: .Result): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=DIVEQ $receiver: GET_VAR 'val result: .Result [val] declared in .box' type=.Result origin=DIVEQ - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null - other: CALL 'public final fun div (_context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' type=.Result origin=DIV + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + other: CALL 'public final fun div ($context_receiver_0: kotlin.Int, other: .Result): .Result [operator] declared in ' type=.Result origin=DIV $receiver: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CONST Int type=kotlin.Int value=4 - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null other: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CONST Int type=kotlin.Int value=2 RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.kt.txt index e7f287e913a..010158f1eae 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.kt.txt @@ -47,16 +47,16 @@ var operationScore: Int get set -operator fun Result.plus(_context_receiver_0: Int, other: Result): Result { +operator fun Result.plus($context_receiver_0: Int, other: Result): Result { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } return Result(i = .().plus(other = other.())) } -operator fun Result.plusAssign(_context_receiver_0: Int, other: Result) { +operator fun Result.plusAssign($context_receiver_0: Int, other: Result) { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } { // BLOCK val tmp0_this: Result = @@ -64,16 +64,16 @@ operator fun Result.plusAssign(_context_receiver_0: Int, other: Result) { } } -operator fun Result.minus(_context_receiver_0: Int, other: Result): Result { +operator fun Result.minus($context_receiver_0: Int, other: Result): Result { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } return Result(i = .().minus(other = other.())) } -operator fun Result.minusAssign(_context_receiver_0: Int, other: Result) { +operator fun Result.minusAssign($context_receiver_0: Int, other: Result) { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } { // BLOCK val tmp0_this: Result = @@ -81,16 +81,16 @@ operator fun Result.minusAssign(_context_receiver_0: Int, other: Result) { } } -operator fun Result.times(_context_receiver_0: Int, other: Result): Result { +operator fun Result.times($context_receiver_0: Int, other: Result): Result { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } return Result(i = .().times(other = other.())) } -operator fun Result.timesAssign(_context_receiver_0: Int, other: Result) { +operator fun Result.timesAssign($context_receiver_0: Int, other: Result) { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } { // BLOCK val tmp0_this: Result = @@ -98,16 +98,16 @@ operator fun Result.timesAssign(_context_receiver_0: Int, other: Result) { } } -operator fun Result.div(_context_receiver_0: Int, other: Result): Result { +operator fun Result.div($context_receiver_0: Int, other: Result): Result { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } return Result(i = .().div(other = other.())) } -operator fun Result.divAssign(_context_receiver_0: Int, other: Result) { +operator fun Result.divAssign($context_receiver_0: Int, other: Result) { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } { // BLOCK val tmp0_this: Result = @@ -118,10 +118,10 @@ operator fun Result.divAssign(_context_receiver_0: Int, other: Result) { fun box(): String { val result: Result = Result(i = 0) with(receiver = 1, block = local fun Int.() { - result.plusAssign(_context_receiver_0 = $this$with, other = Result(i = 1).plus(_context_receiver_0 = $this$with, other = Result(i = 1))) - result.minusAssign(_context_receiver_0 = $this$with, other = Result(i = 1).minus(_context_receiver_0 = $this$with, other = Result(i = 0))) - result.timesAssign(_context_receiver_0 = $this$with, other = Result(i = 1).times(_context_receiver_0 = $this$with, other = Result(i = 2))) - result.divAssign(_context_receiver_0 = $this$with, other = Result(i = 4).div(_context_receiver_0 = $this$with, other = Result(i = 2))) + result.plusAssign($context_receiver_0 = $this$with, other = Result(i = 1).plus($context_receiver_0 = $this$with, other = Result(i = 1))) + result.minusAssign($context_receiver_0 = $this$with, other = Result(i = 1).minus($context_receiver_0 = $this$with, other = Result(i = 0))) + result.timesAssign($context_receiver_0 = $this$with, other = Result(i = 1).times($context_receiver_0 = $this$with, other = Result(i = 2))) + result.divAssign($context_receiver_0 = $this$with, other = Result(i = 4).div($context_receiver_0 = $this$with, other = Result(i = 2))) } ) return when { diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.ir.txt index 7c2160bbf44..1642af731de 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.ir.txt @@ -26,13 +26,13 @@ FILE fqName: fileName:/contextReceiverMethod.kt CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.Context visibility:private [final] - CONSTRUCTOR visibility:public <> (_context_receiver_0:.Context) returnType:.Test [primary] - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Context + CONSTRUCTOR visibility:public <> ($context_receiver_0:.Context) returnType:.Test [primary] + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.Context visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .Test declared in .Test' type=.Test origin=null - value: GET_VAR '_context_receiver_0: .Context declared in .Test.' type=.Context origin=null + value: GET_VAR '$context_receiver_0: .Context declared in .Test.' type=.Context origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]' FUN name:foo visibility:public modality:FINAL <> ($this:.Test) returnType:kotlin.Int $this: VALUE_PARAMETER name: type:.Test diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.kt.txt index b7d74ae7434..d737723cbb8 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextReceiverMethod.kt.txt @@ -13,9 +13,9 @@ class Context { class Test { private /* final field */ val contextReceiverField0: Context - constructor(_context_receiver_0: Context) /* primary */ { + constructor($context_receiver_0: Context) /* primary */ { super/*Any*/() - .#contextReceiverField0 = _context_receiver_0 + .#contextReceiverField0 = $context_receiver_0 /* () */ } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.fir.ir.txt index b25fe1d65a4..5ac35a8bc5a 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.fir.ir.txt @@ -23,44 +23,44 @@ FILE fqName: fileName:/contextualInlineCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testInline visibility:public modality:FINAL <> (_context_receiver_0:.Context) returnType:kotlin.Int [inline] + FUN name:testInline visibility:public modality:FINAL <> ($context_receiver_0:.Context) returnType:kotlin.Int [inline] contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInline (_context_receiver_0: .Context): kotlin.Int [inline] declared in ' + RETURN type=kotlin.Nothing from='public final fun testInline ($context_receiver_0: .Context): kotlin.Int [inline] declared in ' CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '_context_receiver_0: .Context declared in .testInline' type=.Context origin=null - FUN name:testInlineWithArg visibility:public modality:FINAL <> (_context_receiver_0:.Context, i:kotlin.Int) returnType:kotlin.Int [inline] + $this: GET_VAR '$context_receiver_0: .Context declared in .testInline' type=.Context origin=null + FUN name:testInlineWithArg visibility:public modality:FINAL <> ($context_receiver_0:.Context, i:kotlin.Int) returnType:kotlin.Int [inline] contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context VALUE_PARAMETER name:i index:1 type:kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInlineWithArg (_context_receiver_0: .Context, i: kotlin.Int): kotlin.Int [inline] declared in ' + RETURN type=kotlin.Nothing from='public final fun testInlineWithArg ($context_receiver_0: .Context, i: kotlin.Int): kotlin.Int [inline] declared in ' CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS $this: GET_VAR 'i: kotlin.Int declared in .testInlineWithArg' type=kotlin.Int origin=null other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '_context_receiver_0: .Context declared in .testInlineWithArg' type=.Context origin=null - FUN name:testInlineWithExtensionAndArg visibility:public modality:FINAL <> ($receiver:kotlin.Int, _context_receiver_0:.Context, i:kotlin.Int) returnType:kotlin.Int [inline] + $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithArg' type=.Context origin=null + FUN name:testInlineWithExtensionAndArg visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, i:kotlin.Int) returnType:kotlin.Int [inline] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context VALUE_PARAMETER name:i index:1 type:kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndArg (_context_receiver_0: .Context, i: kotlin.Int): kotlin.Int [inline] declared in ' + RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndArg ($context_receiver_0: .Context, i: kotlin.Int): kotlin.Int [inline] declared in ' 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 plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS $this: GET_VAR ': kotlin.Int declared in .testInlineWithExtensionAndArg' type=kotlin.Int origin=null other: GET_VAR 'i: kotlin.Int declared in .testInlineWithExtensionAndArg' type=kotlin.Int origin=null other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '_context_receiver_0: .Context declared in .testInlineWithExtensionAndArg' type=.Context origin=null - FUN name:testInlineWithExtensionAndMultipleArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, _context_receiver_0:.Context, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline] + $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndArg' type=.Context origin=null + FUN name:testInlineWithExtensionAndMultipleArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context VALUE_PARAMETER name:i1 index:1 type:kotlin.Int VALUE_PARAMETER name:i2 index:2 type:kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleArgs (_context_receiver_0: .Context, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' + RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleArgs ($context_receiver_0: .Context, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' 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 plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS @@ -68,7 +68,7 @@ FILE fqName: fileName:/contextualInlineCall.kt other: GET_VAR 'i1: kotlin.Int declared in .testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null other: GET_VAR 'i2: kotlin.Int declared in .testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '_context_receiver_0: .Context declared in .testInlineWithExtensionAndMultipleArgs' type=.Context origin=null + $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndMultipleArgs' type=.Context origin=null CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A CONSTRUCTOR visibility:public <> (a:kotlin.Any?) returnType:.A [primary] @@ -100,11 +100,11 @@ FILE fqName: fileName:/contextualInlineCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testInlineWithExtensionAndMultipleContextsAndArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, _context_receiver_0:.Context, _context_receiver_1:.A, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline] + FUN name:testInlineWithExtensionAndMultipleContextsAndArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, $context_receiver_1:.A, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline] contextReceiverParametersCount: 2 $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Context - VALUE_PARAMETER name:_context_receiver_1 index:1 type:.A + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:$context_receiver_1 index:1 type:.A VALUE_PARAMETER name:i1 index:2 type:kotlin.Int EXPRESSION_BODY CONST Int type=kotlin.Int value=1 @@ -112,7 +112,7 @@ FILE fqName: fileName:/contextualInlineCall.kt EXPRESSION_BODY CONST Int type=kotlin.Int value=2 BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleContextsAndArgs (_context_receiver_0: .Context, _context_receiver_1: .A, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' + RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleContextsAndArgs ($context_receiver_0: .Context, $context_receiver_1: .A, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' 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 plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS @@ -121,12 +121,12 @@ FILE fqName: fileName:/contextualInlineCall.kt other: GET_VAR 'i1: kotlin.Int declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null other: GET_VAR 'i2: kotlin.Int declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '_context_receiver_0: .Context declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=.Context origin=null + $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=.Context origin=null other: WHEN type=kotlin.Int origin=IF BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: CALL 'public final fun (): kotlin.Any? declared in .A' type=kotlin.Any? origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_1: .A declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=.A origin=null + $this: GET_VAR '$context_receiver_1: .A declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=.A origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: CONST Int type=kotlin.Int value=0 BRANCH @@ -148,27 +148,27 @@ FILE fqName: fileName:/contextualInlineCall.kt SET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Unit origin=PLUSEQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Int origin=null - other: CALL 'public final fun testInline (_context_receiver_0: .Context): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null - _context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null + other: CALL 'public final fun testInline ($context_receiver_0: .Context): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null SET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Unit origin=PLUSEQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Int origin=null - other: CALL 'public final fun testInlineWithArg (_context_receiver_0: .Context, i: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null - _context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null + other: CALL 'public final fun testInlineWithArg ($context_receiver_0: .Context, i: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null i: CONST Int type=kotlin.Int value=1 SET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Unit origin=PLUSEQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Int origin=null - other: CALL 'public final fun testInlineWithExtensionAndArg (_context_receiver_0: .Context, i: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null + other: CALL 'public final fun testInlineWithExtensionAndArg ($context_receiver_0: .Context, i: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null $receiver: CONST Int type=kotlin.Int value=1 - _context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null + $context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null i: CONST Int type=kotlin.Int value=1 SET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Unit origin=PLUSEQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Int origin=null - other: CALL 'public final fun testInlineWithExtensionAndMultipleArgs (_context_receiver_0: .Context, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null + other: CALL 'public final fun testInlineWithExtensionAndMultipleArgs ($context_receiver_0: .Context, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null $receiver: CONST Int type=kotlin.Int value=1 - _context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null + $context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null i1: CONST Int type=kotlin.Int value=1 i2: CONST Int type=kotlin.Int value=2 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 @@ -183,19 +183,19 @@ FILE fqName: fileName:/contextualInlineCall.kt SET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Unit origin=PLUSEQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Int origin=null - other: CALL 'public final fun testInlineWithExtensionAndMultipleContextsAndArgs (_context_receiver_0: .Context, _context_receiver_1: .A, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null + other: CALL 'public final fun testInlineWithExtensionAndMultipleContextsAndArgs ($context_receiver_0: .Context, $context_receiver_1: .A, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null $receiver: CONST Int type=kotlin.Int value=1 - _context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null - _context_receiver_1: GET_VAR '$this$with: .A declared in .box..' type=.A origin=null + $context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null + $context_receiver_1: GET_VAR '$this$with: .A declared in .box..' type=.A origin=null i1: CONST Int type=kotlin.Int value=1 i2: CONST Int type=kotlin.Int value=2 SET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Unit origin=PLUSEQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Int origin=null - other: CALL 'public final fun testInlineWithExtensionAndMultipleContextsAndArgs (_context_receiver_0: .Context, _context_receiver_1: .A, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null + other: CALL 'public final fun testInlineWithExtensionAndMultipleContextsAndArgs ($context_receiver_0: .Context, $context_receiver_1: .A, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null $receiver: CONST Int type=kotlin.Int value=1 - _context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null - _context_receiver_1: GET_VAR '$this$with: .A declared in .box..' type=.A origin=null + $context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null + $context_receiver_1: GET_VAR '$this$with: .A declared in .box..' type=.A origin=null RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' WHEN type=kotlin.String origin=IF BRANCH diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.fir.kt.txt index 0bdc80df848..136b3945943 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.fir.kt.txt @@ -11,20 +11,20 @@ class Context { } -inline fun testInline(_context_receiver_0: Context): Int { - return _context_receiver_0.c() +inline fun testInline($context_receiver_0: Context): Int { + return $context_receiver_0.c() } -inline fun testInlineWithArg(_context_receiver_0: Context, i: Int): Int { - return i.plus(other = _context_receiver_0.c()) +inline fun testInlineWithArg($context_receiver_0: Context, i: Int): Int { + return i.plus(other = $context_receiver_0.c()) } -inline fun Int.testInlineWithExtensionAndArg(_context_receiver_0: Context, i: Int): Int { - return .plus(other = i).plus(other = _context_receiver_0.c()) +inline fun Int.testInlineWithExtensionAndArg($context_receiver_0: Context, i: Int): Int { + return .plus(other = i).plus(other = $context_receiver_0.c()) } -inline fun Int.testInlineWithExtensionAndMultipleArgs(_context_receiver_0: Context, i1: Int, i2: Int): Int { - return .plus(other = i1).plus(other = i2).plus(other = _context_receiver_0.c()) +inline fun Int.testInlineWithExtensionAndMultipleArgs($context_receiver_0: Context, i1: Int, i2: Int): Int { + return .plus(other = i1).plus(other = i2).plus(other = $context_receiver_0.c()) } class A { @@ -40,9 +40,9 @@ class A { } -inline fun Int.testInlineWithExtensionAndMultipleContextsAndArgs(_context_receiver_0: Context, _context_receiver_1: A, i1: Int = 1, i2: Int = 2): Int { - return .plus(other = i1).plus(other = i2).plus(other = _context_receiver_0.c()).plus(other = when { - EQEQ(arg0 = _context_receiver_1.(), arg1 = null) -> 0 +inline fun Int.testInlineWithExtensionAndMultipleContextsAndArgs($context_receiver_0: Context, $context_receiver_1: A, i1: Int = 1, i2: Int = 2): Int { + return .plus(other = i1).plus(other = i2).plus(other = $context_receiver_0.c()).plus(other = when { + EQEQ(arg0 = $context_receiver_1.(), arg1 = null) -> 0 else -> 1 }) } @@ -50,13 +50,13 @@ inline fun Int.testInlineWithExtensionAndMultipleContextsAndArgs(_context_receiv fun box(): String { return with(receiver = Context(), block = local fun Context.(): Nothing { var result: Int = 0 - result = result.plus(other = testInline(_context_receiver_0 = $this$with)) - result = result.plus(other = testInlineWithArg(_context_receiver_0 = $this$with, i = 1)) - result = result.plus(other = 1.testInlineWithExtensionAndArg(_context_receiver_0 = $this$with, i = 1)) - result = result.plus(other = 1.testInlineWithExtensionAndMultipleArgs(_context_receiver_0 = $this$with, i1 = 1, i2 = 2)) + result = result.plus(other = testInline($context_receiver_0 = $this$with)) + result = result.plus(other = testInlineWithArg($context_receiver_0 = $this$with, i = 1)) + result = result.plus(other = 1.testInlineWithExtensionAndArg($context_receiver_0 = $this$with, i = 1)) + result = result.plus(other = 1.testInlineWithExtensionAndMultipleArgs($context_receiver_0 = $this$with, i1 = 1, i2 = 2)) with(receiver = A(a = 1), block = local fun A.() { - result = result.plus(other = 1.testInlineWithExtensionAndMultipleContextsAndArgs(_context_receiver_0 = $this$with, _context_receiver_1 = $this$with, i1 = 1, i2 = 2)) - result = result.plus(other = 1.testInlineWithExtensionAndMultipleContextsAndArgs(_context_receiver_0 = $this$with, _context_receiver_1 = $this$with)) + result = result.plus(other = 1.testInlineWithExtensionAndMultipleContextsAndArgs($context_receiver_0 = $this$with, $context_receiver_1 = $this$with, i1 = 1, i2 = 2)) + result = result.plus(other = 1.testInlineWithExtensionAndMultipleContextsAndArgs($context_receiver_0 = $this$with, $context_receiver_1 = $this$with)) } ) return when { diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.ir.txt index b793d728e04..0995284e3b0 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.ir.txt @@ -23,44 +23,44 @@ FILE fqName: fileName:/contextualInlineCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testInline visibility:public modality:FINAL <> (_context_receiver_0:.Context) returnType:kotlin.Int [inline] + FUN name:testInline visibility:public modality:FINAL <> ($context_receiver_0:.Context) returnType:kotlin.Int [inline] contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInline (_context_receiver_0: .Context): kotlin.Int [inline] declared in ' + RETURN type=kotlin.Nothing from='public final fun testInline ($context_receiver_0: .Context): kotlin.Int [inline] declared in ' CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '_context_receiver_0: .Context declared in .testInline' type=.Context origin=null - FUN name:testInlineWithArg visibility:public modality:FINAL <> (_context_receiver_0:.Context, i:kotlin.Int) returnType:kotlin.Int [inline] + $this: GET_VAR '$context_receiver_0: .Context declared in .testInline' type=.Context origin=null + FUN name:testInlineWithArg visibility:public modality:FINAL <> ($context_receiver_0:.Context, i:kotlin.Int) returnType:kotlin.Int [inline] contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context VALUE_PARAMETER name:i index:1 type:kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInlineWithArg (_context_receiver_0: .Context, i: kotlin.Int): kotlin.Int [inline] declared in ' + RETURN type=kotlin.Nothing from='public final fun testInlineWithArg ($context_receiver_0: .Context, i: kotlin.Int): kotlin.Int [inline] declared in ' CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS $this: GET_VAR 'i: kotlin.Int declared in .testInlineWithArg' type=kotlin.Int origin=null other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '_context_receiver_0: .Context declared in .testInlineWithArg' type=.Context origin=null - FUN name:testInlineWithExtensionAndArg visibility:public modality:FINAL <> ($receiver:kotlin.Int, _context_receiver_0:.Context, i:kotlin.Int) returnType:kotlin.Int [inline] + $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithArg' type=.Context origin=null + FUN name:testInlineWithExtensionAndArg visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, i:kotlin.Int) returnType:kotlin.Int [inline] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context VALUE_PARAMETER name:i index:1 type:kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndArg (_context_receiver_0: .Context, i: kotlin.Int): kotlin.Int [inline] declared in ' + RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndArg ($context_receiver_0: .Context, i: kotlin.Int): kotlin.Int [inline] declared in ' 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 plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS $this: GET_VAR ': kotlin.Int declared in .testInlineWithExtensionAndArg' type=kotlin.Int origin=null other: GET_VAR 'i: kotlin.Int declared in .testInlineWithExtensionAndArg' type=kotlin.Int origin=null other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '_context_receiver_0: .Context declared in .testInlineWithExtensionAndArg' type=.Context origin=null - FUN name:testInlineWithExtensionAndMultipleArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, _context_receiver_0:.Context, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline] + $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndArg' type=.Context origin=null + FUN name:testInlineWithExtensionAndMultipleArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context VALUE_PARAMETER name:i1 index:1 type:kotlin.Int VALUE_PARAMETER name:i2 index:2 type:kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleArgs (_context_receiver_0: .Context, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' + RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleArgs ($context_receiver_0: .Context, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' 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 plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS @@ -68,7 +68,7 @@ FILE fqName: fileName:/contextualInlineCall.kt other: GET_VAR 'i1: kotlin.Int declared in .testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null other: GET_VAR 'i2: kotlin.Int declared in .testInlineWithExtensionAndMultipleArgs' type=kotlin.Int origin=null other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '_context_receiver_0: .Context declared in .testInlineWithExtensionAndMultipleArgs' type=.Context origin=null + $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndMultipleArgs' type=.Context origin=null CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A CONSTRUCTOR visibility:public <> (a:kotlin.Any?) returnType:.A [primary] @@ -100,11 +100,11 @@ FILE fqName: fileName:/contextualInlineCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testInlineWithExtensionAndMultipleContextsAndArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, _context_receiver_0:.Context, _context_receiver_1:.A, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline] + FUN name:testInlineWithExtensionAndMultipleContextsAndArgs visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.Context, $context_receiver_1:.A, i1:kotlin.Int, i2:kotlin.Int) returnType:kotlin.Int [inline] contextReceiverParametersCount: 2 $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Context - VALUE_PARAMETER name:_context_receiver_1 index:1 type:.A + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:$context_receiver_1 index:1 type:.A VALUE_PARAMETER name:i1 index:2 type:kotlin.Int EXPRESSION_BODY CONST Int type=kotlin.Int value=1 @@ -112,7 +112,7 @@ FILE fqName: fileName:/contextualInlineCall.kt EXPRESSION_BODY CONST Int type=kotlin.Int value=2 BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleContextsAndArgs (_context_receiver_0: .Context, _context_receiver_1: .A, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' + RETURN type=kotlin.Nothing from='public final fun testInlineWithExtensionAndMultipleContextsAndArgs ($context_receiver_0: .Context, $context_receiver_1: .A, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' 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 plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS @@ -121,12 +121,12 @@ FILE fqName: fileName:/contextualInlineCall.kt other: GET_VAR 'i1: kotlin.Int declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null other: GET_VAR 'i2: kotlin.Int declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=kotlin.Int origin=null other: CALL 'public final fun c (): kotlin.Int declared in .Context' type=kotlin.Int origin=null - $this: GET_VAR '_context_receiver_0: .Context declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=.Context origin=null + $this: GET_VAR '$context_receiver_0: .Context declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=.Context origin=null other: WHEN type=kotlin.Int origin=IF BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: CALL 'public final fun (): kotlin.Any? declared in .A' type=kotlin.Any? origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_1: .A declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=.A origin=null + $this: GET_VAR '$context_receiver_1: .A declared in .testInlineWithExtensionAndMultipleContextsAndArgs' type=.A origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: CONST Int type=kotlin.Int value=0 BRANCH @@ -148,27 +148,27 @@ FILE fqName: fileName:/contextualInlineCall.kt SET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Unit origin=PLUSEQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: GET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Int origin=PLUSEQ - other: CALL 'public final fun testInline (_context_receiver_0: .Context): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null - _context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null + other: CALL 'public final fun testInline ($context_receiver_0: .Context): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null SET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Unit origin=PLUSEQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: GET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Int origin=PLUSEQ - other: CALL 'public final fun testInlineWithArg (_context_receiver_0: .Context, i: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null - _context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null + other: CALL 'public final fun testInlineWithArg ($context_receiver_0: .Context, i: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null i: CONST Int type=kotlin.Int value=1 SET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Unit origin=PLUSEQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: GET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Int origin=PLUSEQ - other: CALL 'public final fun testInlineWithExtensionAndArg (_context_receiver_0: .Context, i: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null + other: CALL 'public final fun testInlineWithExtensionAndArg ($context_receiver_0: .Context, i: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null $receiver: CONST Int type=kotlin.Int value=1 - _context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null + $context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null i: CONST Int type=kotlin.Int value=1 SET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Unit origin=PLUSEQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: GET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Int origin=PLUSEQ - other: CALL 'public final fun testInlineWithExtensionAndMultipleArgs (_context_receiver_0: .Context, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null + other: CALL 'public final fun testInlineWithExtensionAndMultipleArgs ($context_receiver_0: .Context, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null $receiver: CONST Int type=kotlin.Int value=1 - _context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null + $context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null i1: CONST Int type=kotlin.Int value=1 i2: CONST Int type=kotlin.Int value=2 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 @@ -183,19 +183,19 @@ FILE fqName: fileName:/contextualInlineCall.kt SET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Unit origin=PLUSEQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: GET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Int origin=PLUSEQ - other: CALL 'public final fun testInlineWithExtensionAndMultipleContextsAndArgs (_context_receiver_0: .Context, _context_receiver_1: .A, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null + other: CALL 'public final fun testInlineWithExtensionAndMultipleContextsAndArgs ($context_receiver_0: .Context, $context_receiver_1: .A, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null $receiver: CONST Int type=kotlin.Int value=1 - _context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null - _context_receiver_1: GET_VAR '$this$with: .A declared in .box..' type=.A origin=null + $context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null + $context_receiver_1: GET_VAR '$this$with: .A declared in .box..' type=.A origin=null i1: CONST Int type=kotlin.Int value=1 i2: CONST Int type=kotlin.Int value=2 SET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Unit origin=PLUSEQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: GET_VAR 'var result: kotlin.Int [var] declared in .box.' type=kotlin.Int origin=PLUSEQ - other: CALL 'public final fun testInlineWithExtensionAndMultipleContextsAndArgs (_context_receiver_0: .Context, _context_receiver_1: .A, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null + other: CALL 'public final fun testInlineWithExtensionAndMultipleContextsAndArgs ($context_receiver_0: .Context, $context_receiver_1: .A, i1: kotlin.Int, i2: kotlin.Int): kotlin.Int [inline] declared in ' type=kotlin.Int origin=null $receiver: CONST Int type=kotlin.Int value=1 - _context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null - _context_receiver_1: GET_VAR '$this$with: .A declared in .box..' type=.A origin=null + $context_receiver_0: GET_VAR '$this$with: .Context declared in .box.' type=.Context origin=null + $context_receiver_1: GET_VAR '$this$with: .A declared in .box..' type=.A origin=null RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' WHEN type=kotlin.String origin=IF BRANCH diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.kt.txt index 7eb5e64b6da..db442f9c163 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualInlineCall.kt.txt @@ -11,20 +11,20 @@ class Context { } -inline fun testInline(_context_receiver_0: Context): Int { - return _context_receiver_0.c() +inline fun testInline($context_receiver_0: Context): Int { + return $context_receiver_0.c() } -inline fun testInlineWithArg(_context_receiver_0: Context, i: Int): Int { - return i.plus(other = _context_receiver_0.c()) +inline fun testInlineWithArg($context_receiver_0: Context, i: Int): Int { + return i.plus(other = $context_receiver_0.c()) } -inline fun Int.testInlineWithExtensionAndArg(_context_receiver_0: Context, i: Int): Int { - return .plus(other = i).plus(other = _context_receiver_0.c()) +inline fun Int.testInlineWithExtensionAndArg($context_receiver_0: Context, i: Int): Int { + return .plus(other = i).plus(other = $context_receiver_0.c()) } -inline fun Int.testInlineWithExtensionAndMultipleArgs(_context_receiver_0: Context, i1: Int, i2: Int): Int { - return .plus(other = i1).plus(other = i2).plus(other = _context_receiver_0.c()) +inline fun Int.testInlineWithExtensionAndMultipleArgs($context_receiver_0: Context, i1: Int, i2: Int): Int { + return .plus(other = i1).plus(other = i2).plus(other = $context_receiver_0.c()) } class A { @@ -40,9 +40,9 @@ class A { } -inline fun Int.testInlineWithExtensionAndMultipleContextsAndArgs(_context_receiver_0: Context, _context_receiver_1: A, i1: Int = 1, i2: Int = 2): Int { - return .plus(other = i1).plus(other = i2).plus(other = _context_receiver_0.c()).plus(other = when { - EQEQ(arg0 = _context_receiver_1.(), arg1 = null) -> 0 +inline fun Int.testInlineWithExtensionAndMultipleContextsAndArgs($context_receiver_0: Context, $context_receiver_1: A, i1: Int = 1, i2: Int = 2): Int { + return .plus(other = i1).plus(other = i2).plus(other = $context_receiver_0.c()).plus(other = when { + EQEQ(arg0 = $context_receiver_1.(), arg1 = null) -> 0 else -> 1 }) } @@ -50,13 +50,13 @@ inline fun Int.testInlineWithExtensionAndMultipleContextsAndArgs(_context_receiv fun box(): String { return with(receiver = Context(), block = local fun Context.(): Nothing { var result: Int = 0 - result = result.plus(other = testInline(_context_receiver_0 = $this$with)) - result = result.plus(other = testInlineWithArg(_context_receiver_0 = $this$with, i = 1)) - result = result.plus(other = 1.testInlineWithExtensionAndArg(_context_receiver_0 = $this$with, i = 1)) - result = result.plus(other = 1.testInlineWithExtensionAndMultipleArgs(_context_receiver_0 = $this$with, i1 = 1, i2 = 2)) + result = result.plus(other = testInline($context_receiver_0 = $this$with)) + result = result.plus(other = testInlineWithArg($context_receiver_0 = $this$with, i = 1)) + result = result.plus(other = 1.testInlineWithExtensionAndArg($context_receiver_0 = $this$with, i = 1)) + result = result.plus(other = 1.testInlineWithExtensionAndMultipleArgs($context_receiver_0 = $this$with, i1 = 1, i2 = 2)) with(receiver = A(a = 1), block = local fun A.() { - result = result.plus(other = 1.testInlineWithExtensionAndMultipleContextsAndArgs(_context_receiver_0 = $this$with, _context_receiver_1 = $this$with, i1 = 1, i2 = 2)) - result = result.plus(other = 1.testInlineWithExtensionAndMultipleContextsAndArgs(_context_receiver_0 = $this$with, _context_receiver_1 = $this$with)) + result = result.plus(other = 1.testInlineWithExtensionAndMultipleContextsAndArgs($context_receiver_0 = $this$with, $context_receiver_1 = $this$with, i1 = 1, i2 = 2)) + result = result.plus(other = 1.testInlineWithExtensionAndMultipleContextsAndArgs($context_receiver_0 = $this$with, $context_receiver_1 = $this$with)) } ) return when { diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.ir.txt index 29077396e4f..0f710117aba 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.ir.txt @@ -33,14 +33,14 @@ FILE fqName: fileName:/contextualPrimaryConstructorWithParams.kt CLASS CLASS name:OK modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OK FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.O visibility:private [final] - CONSTRUCTOR visibility:public <> (_context_receiver_0:.O, k:kotlin.String) returnType:.OK [primary] - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.O + CONSTRUCTOR visibility:public <> ($context_receiver_0:.O, k:kotlin.String) returnType:.OK [primary] + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.O VALUE_PARAMETER name:k index:1 type:kotlin.String BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.O visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .OK declared in .OK' type=.OK origin=null - value: GET_VAR '_context_receiver_0: .O declared in .OK.' type=.O origin=null + value: GET_VAR '$context_receiver_0: .O declared in .OK.' type=.O origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OK modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:k visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:k type:kotlin.String visibility:private [final] @@ -95,8 +95,8 @@ FILE fqName: fileName:/contextualPrimaryConstructorWithParams.kt $receiver: VALUE_PARAMETER name:$this$with type:.O BLOCK_BODY VAR name:ok type:.OK [val] - CONSTRUCTOR_CALL 'public constructor (_context_receiver_0: .O, k: kotlin.String) [primary] declared in .OK' type=.OK origin=null - _context_receiver_0: GET_VAR '$this$with: .O declared in .box.' type=.O origin=null + CONSTRUCTOR_CALL 'public constructor ($context_receiver_0: .O, k: kotlin.String) [primary] declared in .OK' type=.OK origin=null + $context_receiver_0: GET_VAR '$this$with: .O declared in .box.' type=.O origin=null k: CONST String type=kotlin.String value="K" RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' CALL 'public final fun (): kotlin.String declared in .OK' type=kotlin.String origin=GET_PROPERTY diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.kt.txt index fe771d02ea0..cb031fef033 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/contextualPrimaryConstructorWithParams.kt.txt @@ -13,9 +13,9 @@ class O { class OK { private /* final field */ val contextReceiverField0: O - constructor(_context_receiver_0: O, k: String) /* primary */ { + constructor($context_receiver_0: O, k: String) /* primary */ { super/*Any*/() - .#contextReceiverField0 = _context_receiver_0 + .#contextReceiverField0 = $context_receiver_0 /* () */ } @@ -32,7 +32,7 @@ class OK { fun box(): String { return with(receiver = O(o = "O"), block = local fun O.(): String { - val ok: OK = OK(_context_receiver_0 = $this$with, k = "K") + val ok: OK = OK($context_receiver_0 = $this$with, k = "K") return ok.() } ) diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.ir.txt index 9626931a760..89b20370e80 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.ir.txt @@ -39,24 +39,24 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegateValue type:kotlin.String visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Delegate declared in .Delegate.' type=.Delegate origin=null value: GET_VAR ': kotlin.String declared in .Delegate.' type=kotlin.String origin=null - FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, _context_receiver_0:kotlin.Int, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>) returnType:kotlin.String [operator] + FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, $context_receiver_0:kotlin.Int, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>) returnType:kotlin.String [operator] $this: VALUE_PARAMETER name: type:.Delegate contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:thisRef index:1 type:kotlin.Any? VALUE_PARAMETER name:property index:2 type:kotlin.reflect.KProperty<*> BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .Delegate.getValue' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun getValue (_context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): kotlin.String [operator] declared in .Delegate' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .Delegate.getValue' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun getValue ($context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): kotlin.String [operator] declared in .Delegate' CALL 'public final fun (): kotlin.String declared in .Delegate' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR ': .Delegate declared in .Delegate.getValue' type=.Delegate origin=null - FUN name:setValue visibility:public modality:FINAL <> ($this:.Delegate, _context_receiver_0:kotlin.Int, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>, value:kotlin.String) returnType:kotlin.Unit [operator] + FUN name:setValue visibility:public modality:FINAL <> ($this:.Delegate, $context_receiver_0:kotlin.Int, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>, value:kotlin.String) returnType:kotlin.Unit [operator] $this: VALUE_PARAMETER name: type:.Delegate contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:thisRef index:1 type:kotlin.Any? VALUE_PARAMETER name:property index:2 type:kotlin.reflect.KProperty<*> VALUE_PARAMETER name:value index:3 type:kotlin.String @@ -64,7 +64,7 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .Delegate.setValue' type=kotlin.Int origin=null + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .Delegate.setValue' type=kotlin.Int origin=null CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=EQ $this: GET_VAR ': .Delegate declared in .Delegate.setValue' type=.Delegate origin=null : GET_VAR 'value: kotlin.String declared in .Delegate.setValue' type=kotlin.String origin=null @@ -84,13 +84,13 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt CLASS CLASS name:Result modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Result FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final] - CONSTRUCTOR visibility:public <> (_context_receiver_0:kotlin.Int) returnType:.Result [primary] - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + CONSTRUCTOR visibility:public <> ($context_receiver_0:kotlin.Int) returnType:.Result [primary] + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .Result declared in .Result' type=.Result origin=null - value: GET_VAR '_context_receiver_0: kotlin.Int declared in .Result.' type=kotlin.Int origin=null + value: GET_VAR '$context_receiver_0: kotlin.Int declared in .Result.' type=kotlin.Int origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:s visibility:public modality:FINAL [delegated,var] FIELD PROPERTY_DELEGATE name:s$delegate type:.Delegate visibility:private [final] @@ -101,10 +101,10 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Result' - CALL 'public final fun getValue (_context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): kotlin.String [operator] declared in .Delegate' type=kotlin.String origin=null + CALL 'public final fun getValue ($context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): kotlin.String [operator] declared in .Delegate' type=kotlin.String origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:s$delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null - _context_receiver_0: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + $context_receiver_0: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null thisRef: GET_VAR ': .Result declared in .Result.' type=.Result origin=null property: PROPERTY_REFERENCE 'public final s: kotlin.String [delegated,var]' field=null getter='public final fun (): kotlin.String declared in .Result' setter='public final fun (: kotlin.String): kotlin.Unit declared in .Result' type=kotlin.reflect.KMutableProperty1<.Result, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE @@ -113,10 +113,10 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt $this: VALUE_PARAMETER name: type:.Result VALUE_PARAMETER name: index:0 type:kotlin.String BLOCK_BODY - CALL 'public final fun setValue (_context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: kotlin.String): kotlin.Unit [operator] declared in .Delegate' type=kotlin.Unit origin=null + CALL 'public final fun setValue ($context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: kotlin.String): kotlin.Unit [operator] declared in .Delegate' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:s$delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null - _context_receiver_0: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + $context_receiver_0: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null thisRef: GET_VAR ': .Result declared in .Result.' type=.Result origin=null property: PROPERTY_REFERENCE 'public final s: kotlin.String [delegated,var]' field=null getter='public final fun (): kotlin.String declared in .Result' setter='public final fun (: kotlin.String): kotlin.Unit declared in .Result' type=kotlin.reflect.KMutableProperty1<.Result, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE @@ -146,8 +146,8 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt $receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): .Result declared in .box' - CONSTRUCTOR_CALL 'public constructor (_context_receiver_0: kotlin.Int) [primary] declared in .Result' type=.Result origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + CONSTRUCTOR_CALL 'public constructor ($context_receiver_0: kotlin.Int) [primary] declared in .Result' type=.Result origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .Result' type=kotlin.Unit origin=EQ $this: GET_VAR 'val result: .Result [val] declared in .box' type=.Result origin=null : CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.kt.txt index 151b5e14fe0..dda10edc693 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.kt.txt @@ -15,13 +15,13 @@ class Delegate { get set - operator fun getValue(_context_receiver_0: Int, thisRef: Any?, property: KProperty<*>): String { - ( = ().plus(other = _context_receiver_0)) + operator fun getValue($context_receiver_0: Int, thisRef: Any?, property: KProperty<*>): String { + ( = ().plus(other = $context_receiver_0)) return .() } - operator fun setValue(_context_receiver_0: Int, thisRef: Any?, property: KProperty<*>, value: String) { - ( = ().plus(other = _context_receiver_0)) + operator fun setValue($context_receiver_0: Int, thisRef: Any?, property: KProperty<*>, value: String) { + ( = ().plus(other = $context_receiver_0)) .( = value) } @@ -29,9 +29,9 @@ class Delegate { class Result { private /* final field */ val contextReceiverField0: Int - constructor(_context_receiver_0: Int) /* primary */ { + constructor($context_receiver_0: Int) /* primary */ { super/*Any*/() - .#contextReceiverField0 = _context_receiver_0 + .#contextReceiverField0 = $context_receiver_0 /* () */ } @@ -39,17 +39,17 @@ class Result { var s: String /* by */ field = Delegate() get(): String { - return .#s$delegate.getValue(_context_receiver_0 = .#contextReceiverField0, thisRef = , property = Result::s) + return .#s$delegate.getValue($context_receiver_0 = .#contextReceiverField0, thisRef = , property = Result::s) } set(: String) { - .#s$delegate.setValue(_context_receiver_0 = .#contextReceiverField0, thisRef = , property = Result::s, value = ) + .#s$delegate.setValue($context_receiver_0 = .#contextReceiverField0, thisRef = , property = Result::s, value = ) } } fun box(): String { val result: Result = with(receiver = 1, block = local fun Int.(): Result { - return Result(_context_receiver_0 = $this$with) + return Result($context_receiver_0 = $this$with) } ) result.( = "OK") diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.ir.txt index c75eb707e04..591249734d1 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.ir.txt @@ -39,10 +39,10 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegateValue type:kotlin.String visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Delegate declared in .Delegate.' type=.Delegate origin=null value: GET_VAR ': kotlin.String declared in .Delegate.' type=kotlin.String origin=null - FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, _context_receiver_0:kotlin.Int, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>) returnType:kotlin.String [operator] + FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, $context_receiver_0:kotlin.Int, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>) returnType:kotlin.String [operator] $this: VALUE_PARAMETER name: type:.Delegate contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:thisRef index:1 type:kotlin.Any? VALUE_PARAMETER name:property index:2 type:kotlin.reflect.KProperty<*> BLOCK_BODY @@ -50,14 +50,14 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .Delegate.getValue' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun getValue (_context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): kotlin.String [operator] declared in .Delegate' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .Delegate.getValue' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun getValue ($context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): kotlin.String [operator] declared in .Delegate' CALL 'public final fun (): kotlin.String declared in .Delegate' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR ': .Delegate declared in .Delegate.getValue' type=.Delegate origin=null - FUN name:setValue visibility:public modality:FINAL <> ($this:.Delegate, _context_receiver_0:kotlin.Int, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>, value:kotlin.String) returnType:kotlin.Unit [operator] + FUN name:setValue visibility:public modality:FINAL <> ($this:.Delegate, $context_receiver_0:kotlin.Int, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>, value:kotlin.String) returnType:kotlin.Unit [operator] $this: VALUE_PARAMETER name: type:.Delegate contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int VALUE_PARAMETER name:thisRef index:1 type:kotlin.Any? VALUE_PARAMETER name:property index:2 type:kotlin.reflect.KProperty<*> VALUE_PARAMETER name:value index:3 type:kotlin.String @@ -66,7 +66,7 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .Delegate.setValue' type=kotlin.Int origin=null + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .Delegate.setValue' type=kotlin.Int origin=null CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=EQ $this: GET_VAR ': .Delegate declared in .Delegate.setValue' type=.Delegate origin=null : GET_VAR 'value: kotlin.String declared in .Delegate.setValue' type=kotlin.String origin=null @@ -86,13 +86,13 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt CLASS CLASS name:Result modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Result FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final] - CONSTRUCTOR visibility:public <> (_context_receiver_0:kotlin.Int) returnType:.Result [primary] - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + CONSTRUCTOR visibility:public <> ($context_receiver_0:kotlin.Int) returnType:.Result [primary] + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .Result declared in .Result' type=.Result origin=null - value: GET_VAR '_context_receiver_0: kotlin.Int declared in .Result.' type=kotlin.Int origin=null + value: GET_VAR '$context_receiver_0: kotlin.Int declared in .Result.' type=kotlin.Int origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Result modality:FINAL visibility:public superTypes:[kotlin.Any]' PROPERTY name:s visibility:public modality:FINAL [delegated,var] FIELD PROPERTY_DELEGATE name:s$delegate type:.Delegate visibility:private [final] @@ -103,10 +103,10 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Result' - CALL 'public final fun getValue (_context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): kotlin.String [operator] declared in .Delegate' type=kotlin.String origin=null + CALL 'public final fun getValue ($context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): kotlin.String [operator] declared in .Delegate' type=kotlin.String origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:s$delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null - _context_receiver_0: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + $context_receiver_0: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null thisRef: GET_VAR ': .Result declared in .Result.' type=.Result origin=null property: PROPERTY_REFERENCE 'public final s: kotlin.String [delegated,var]' field=null getter='public final fun (): kotlin.String declared in .Result' setter='public final fun (: kotlin.String): kotlin.Unit declared in .Result' type=kotlin.reflect.KMutableProperty1<.Result, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE @@ -116,10 +116,10 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt VALUE_PARAMETER name: index:0 type:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (: kotlin.String): kotlin.Unit declared in .Result' - CALL 'public final fun setValue (_context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: kotlin.String): kotlin.Unit [operator] declared in .Delegate' type=kotlin.Unit origin=null + CALL 'public final fun setValue ($context_receiver_0: kotlin.Int, thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: kotlin.String): kotlin.Unit [operator] declared in .Delegate' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:s$delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null - _context_receiver_0: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + $context_receiver_0: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null thisRef: GET_VAR ': .Result declared in .Result.' type=.Result origin=null property: PROPERTY_REFERENCE 'public final s: kotlin.String [delegated,var]' field=null getter='public final fun (): kotlin.String declared in .Result' setter='public final fun (: kotlin.String): kotlin.Unit declared in .Result' type=kotlin.reflect.KMutableProperty1<.Result, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE @@ -149,8 +149,8 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt $receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): .Result declared in .box' - CONSTRUCTOR_CALL 'public constructor (_context_receiver_0: kotlin.Int) [primary] declared in .Result' type=.Result origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + CONSTRUCTOR_CALL 'public constructor ($context_receiver_0: kotlin.Int) [primary] declared in .Result' type=.Result origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .Result' type=kotlin.Unit origin=EQ $this: GET_VAR 'val result: .Result [val] declared in .box' type=.Result origin=null : CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.kt.txt index 729a50c0552..f1df42f2044 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.kt.txt @@ -15,16 +15,16 @@ class Delegate { get set - operator fun getValue(_context_receiver_0: Int, thisRef: Any?, property: KProperty<*>): String { + operator fun getValue($context_receiver_0: Int, thisRef: Any?, property: KProperty<*>): String { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } return .() } - operator fun setValue(_context_receiver_0: Int, thisRef: Any?, property: KProperty<*>, value: String) { + operator fun setValue($context_receiver_0: Int, thisRef: Any?, property: KProperty<*>, value: String) { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } .( = value) } @@ -33,9 +33,9 @@ class Delegate { class Result { private /* final field */ val contextReceiverField0: Int - constructor(_context_receiver_0: Int) /* primary */ { + constructor($context_receiver_0: Int) /* primary */ { super/*Any*/() - .#contextReceiverField0 = _context_receiver_0 + .#contextReceiverField0 = $context_receiver_0 /* () */ } @@ -43,17 +43,17 @@ class Result { var s: String /* by */ field = Delegate() get(): String { - return .#s$delegate.getValue(_context_receiver_0 = .#contextReceiverField0, thisRef = , property = Result::s) + return .#s$delegate.getValue($context_receiver_0 = .#contextReceiverField0, thisRef = , property = Result::s) } set(: String) { - return .#s$delegate.setValue(_context_receiver_0 = .#contextReceiverField0, thisRef = , property = Result::s, value = ) + return .#s$delegate.setValue($context_receiver_0 = .#contextReceiverField0, thisRef = , property = Result::s, value = ) } } fun box(): String { val result: Result = with(receiver = 1, block = local fun Int.(): Result { - return Result(_context_receiver_0 = $this$with) + return Result($context_receiver_0 = $this$with) } ) result.( = "OK") diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.ir.txt index 05866f85100..56e9b878f10 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.ir.txt @@ -20,10 +20,10 @@ FILE fqName: fileName:/canvas.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS INTERFACE name:Shape modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Shape - FUN name:draw visibility:public modality:ABSTRACT <> ($this:.Shape, _context_receiver_0:.Canvas) returnType:kotlin.String + FUN name:draw visibility:public modality:ABSTRACT <> ($this:.Shape, $context_receiver_0:.Canvas) returnType:kotlin.String $this: VALUE_PARAMETER name: type:.Shape contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Canvas + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Canvas 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 @@ -43,18 +43,18 @@ FILE fqName: fileName:/canvas.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Circle modality:FINAL visibility:public superTypes:[.Shape]' - FUN name:draw visibility:public modality:OPEN <> ($this:.Circle, _context_receiver_0:.Canvas) returnType:kotlin.String + FUN name:draw visibility:public modality:OPEN <> ($this:.Circle, $context_receiver_0:.Canvas) returnType:kotlin.String overridden: - public abstract fun draw (_context_receiver_0: .Canvas): kotlin.String declared in .Shape + public abstract fun draw ($context_receiver_0: .Canvas): kotlin.String declared in .Shape $this: VALUE_PARAMETER name: type:.Circle contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Canvas + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Canvas BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun draw (_context_receiver_0: .Canvas): kotlin.String declared in .Circle' + RETURN type=kotlin.Nothing from='public open fun draw ($context_receiver_0: .Canvas): kotlin.String declared in .Circle' CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS $this: CONST String type=kotlin.String value="OK" other: CALL 'public abstract fun (): kotlin.String declared in .Canvas' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .Canvas declared in .Circle.draw' type=.Canvas origin=null + $this: GET_VAR '$context_receiver_0: .Canvas declared in .Circle.draw' type=.Canvas 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 [fake_override,operator] declared in .Shape @@ -114,6 +114,6 @@ FILE fqName: fileName:/canvas.kt $receiver: VALUE_PARAMETER name:$this$with type:.MyCanvas BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' - CALL 'public open fun draw (_context_receiver_0: .Canvas): kotlin.String declared in .Circle' type=kotlin.String origin=null + CALL 'public open fun draw ($context_receiver_0: .Canvas): kotlin.String declared in .Circle' type=kotlin.String origin=null $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Circle' type=.Circle origin=null - _context_receiver_0: GET_VAR '$this$with: .MyCanvas declared in .box.' type=.MyCanvas origin=null + $context_receiver_0: GET_VAR '$this$with: .MyCanvas declared in .box.' type=.MyCanvas origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt.txt index de3ee4a56ad..11800ad493c 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/canvas.kt.txt @@ -5,7 +5,7 @@ interface Canvas { } interface Shape { - abstract fun draw(_context_receiver_0: Canvas): String + abstract fun draw($context_receiver_0: Canvas): String } @@ -16,8 +16,8 @@ class Circle : Shape { } - override fun draw(_context_receiver_0: Canvas): String { - return "OK".plus(other = _context_receiver_0.()) + override fun draw($context_receiver_0: Canvas): String { + return "OK".plus(other = $context_receiver_0.()) } } @@ -37,7 +37,7 @@ object MyCanvas : Canvas { fun box(): String { return with(receiver = MyCanvas, block = local fun MyCanvas.(): String { - return Circle().draw(_context_receiver_0 = $this$with) + return Circle().draw($context_receiver_0 = $this$with) } ) } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.ir.txt index 1b18359e48f..0872ede681b 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.ir.txt @@ -157,35 +157,35 @@ FILE fqName: fileName:/compareTo.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.toString' type=.Pair.Pair, B of .Pair> origin=null CONST String type=kotlin.String value=")" - FUN name:compareTo visibility:public modality:FINAL ($receiver:T of .compareTo, _context_receiver_0:java.util.Comparator.compareTo>, other:T of .compareTo) returnType:kotlin.Int [operator,infix] + FUN name:compareTo visibility:public modality:FINAL ($receiver:T of .compareTo, $context_receiver_0:java.util.Comparator.compareTo>, other:T of .compareTo) returnType:kotlin.Int [operator,infix] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:T of .compareTo - VALUE_PARAMETER name:_context_receiver_0 index:0 type:java.util.Comparator.compareTo> + VALUE_PARAMETER name:$context_receiver_0 index:0 type:java.util.Comparator.compareTo> VALUE_PARAMETER name:other index:1 type:T of .compareTo BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun compareTo (_context_receiver_0: java.util.Comparator.compareTo>, other: T of .compareTo): kotlin.Int [operator,infix] declared in ' + RETURN type=kotlin.Nothing from='public final fun compareTo ($context_receiver_0: java.util.Comparator.compareTo>, other: T of .compareTo): kotlin.Int [operator,infix] declared in ' CALL 'public abstract fun compare (p0: @[FlexibleNullability] T of java.util.Comparator?, p1: @[FlexibleNullability] T of java.util.Comparator?): kotlin.Int declared in java.util.Comparator' type=kotlin.Int origin=null - $this: GET_VAR '_context_receiver_0: java.util.Comparator.compareTo> declared in .compareTo' type=java.util.Comparator.compareTo> origin=null + $this: GET_VAR '$context_receiver_0: java.util.Comparator.compareTo> declared in .compareTo' type=java.util.Comparator.compareTo> origin=null p0: GET_VAR ': T of .compareTo declared in .compareTo' type=T of .compareTo origin=null p1: GET_VAR 'other: T of .compareTo declared in .compareTo' type=T of .compareTo origin=null PROPERTY name:min visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL ($receiver:.Pair., T of .>, _context_receiver_0:java.util.Comparator.>) returnType:T of . + FUN name: visibility:public modality:FINAL ($receiver:.Pair., T of .>, $context_receiver_0:java.util.Comparator.>) returnType:T of . correspondingProperty: PROPERTY name:min visibility:public modality:FINAL [val] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Pair., T of .> - VALUE_PARAMETER name:_context_receiver_0 index:0 type:java.util.Comparator.> + VALUE_PARAMETER name:$context_receiver_0 index:0 type:java.util.Comparator.> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (_context_receiver_0: java.util.Comparator.>): T of . declared in ' + RETURN type=kotlin.Nothing from='public final fun ($context_receiver_0: java.util.Comparator.>): T of . declared in ' WHEN type=T of . origin=IF BRANCH if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: CALL 'public final fun compareTo (_context_receiver_0: java.util.Comparator.compareTo>, other: T of .compareTo): kotlin.Int [operator,infix] declared in ' type=kotlin.Int origin=null + arg0: CALL 'public final fun compareTo ($context_receiver_0: java.util.Comparator.compareTo>, other: T of .compareTo): kotlin.Int [operator,infix] declared in ' type=kotlin.Int origin=null : T of . $receiver: CALL 'public final fun (): A of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null - _context_receiver_0: GET_VAR '_context_receiver_0: java.util.Comparator.> declared in .' type=java.util.Comparator.> origin=null + $context_receiver_0: GET_VAR '$context_receiver_0: java.util.Comparator.> declared in .' type=java.util.Comparator.> origin=null other: CALL 'public final fun (): B of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null arg1: CONST Int type=kotlin.Int value=0 @@ -236,11 +236,11 @@ FILE fqName: fileName:/compareTo.kt $receiver: VALUE_PARAMETER name:$this$with type:java.util.Comparator BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' - CALL 'public final fun (_context_receiver_0: java.util.Comparator.>): T of . declared in ' type=kotlin.String origin=GET_PROPERTY + CALL 'public final fun ($context_receiver_0: java.util.Comparator.>): T of . declared in ' type=kotlin.String origin=GET_PROPERTY : kotlin.String $receiver: CONSTRUCTOR_CALL 'public constructor (first: A of .Pair, second: B of .Pair) [primary] declared in .Pair' type=.Pair origin=null : kotlin.String : kotlin.String first: CONST String type=kotlin.String value="OK" second: CONST String type=kotlin.String value="fail" - _context_receiver_0: GET_VAR '$this$with: java.util.Comparator declared in .box.' type=java.util.Comparator origin=null + $context_receiver_0: GET_VAR '$this$with: java.util.Comparator declared in .box.' type=java.util.Comparator origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.kt.txt index 4d012fc171b..9665cd0de45 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.kt.txt @@ -60,14 +60,14 @@ data class Pair { } -infix operator fun T.compareTo(_context_receiver_0: Comparator, other: T): Int { - return _context_receiver_0.compare(p0 = , p1 = other) +infix operator fun T.compareTo($context_receiver_0: Comparator, other: T): Int { + return $context_receiver_0.compare(p0 = , p1 = other) } val Pair.min: T - get(_context_receiver_0: Comparator): T { + get($context_receiver_0: Comparator): T { return when { - less(arg0 = .().compareTo(_context_receiver_0 = _context_receiver_0, other = .()), arg1 = 0) -> .() + less(arg0 = .().compareTo($context_receiver_0 = $context_receiver_0, other = .()), arg1 = 0) -> .() else -> .() } } @@ -84,7 +84,7 @@ fun box(): String { } /*-> Comparator */ return with, String>(receiver = comparator, block = local fun Comparator.(): String { - return Pair(first = "OK", second = "fail").(_context_receiver_0 = $this$with) + return Pair(first = "OK", second = "fail").($context_receiver_0 = $this$with) } ) } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.ir.txt index c06ca9d30f3..eed5e999748 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.ir.txt @@ -157,35 +157,35 @@ FILE fqName: fileName:/compareTo.kt CONST Boolean type=kotlin.Boolean value=false RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Pair' CONST Boolean type=kotlin.Boolean value=true - FUN name:compareTo visibility:public modality:FINAL ($receiver:T of .compareTo, _context_receiver_0:java.util.Comparator.compareTo>{ kotlin.TypeAliasesKt.Comparator.compareTo> }, other:T of .compareTo) returnType:kotlin.Int [operator,infix] + FUN name:compareTo visibility:public modality:FINAL ($receiver:T of .compareTo, $context_receiver_0:java.util.Comparator.compareTo>{ kotlin.TypeAliasesKt.Comparator.compareTo> }, other:T of .compareTo) returnType:kotlin.Int [operator,infix] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:T of .compareTo - VALUE_PARAMETER name:_context_receiver_0 index:0 type:java.util.Comparator.compareTo>{ kotlin.TypeAliasesKt.Comparator.compareTo> } + VALUE_PARAMETER name:$context_receiver_0 index:0 type:java.util.Comparator.compareTo>{ kotlin.TypeAliasesKt.Comparator.compareTo> } VALUE_PARAMETER name:other index:1 type:T of .compareTo BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun compareTo (_context_receiver_0: java.util.Comparator.compareTo>{ kotlin.TypeAliasesKt.Comparator.compareTo> }, other: T of .compareTo): kotlin.Int [operator,infix] declared in ' + RETURN type=kotlin.Nothing from='public final fun compareTo ($context_receiver_0: java.util.Comparator.compareTo>{ kotlin.TypeAliasesKt.Comparator.compareTo> }, other: T of .compareTo): kotlin.Int [operator,infix] declared in ' CALL 'public abstract fun compare (p0: @[FlexibleNullability] T of java.util.Comparator?, p1: @[FlexibleNullability] T of java.util.Comparator?): kotlin.Int declared in java.util.Comparator' type=kotlin.Int origin=null - $this: GET_VAR '_context_receiver_0: java.util.Comparator.compareTo>{ kotlin.TypeAliasesKt.Comparator.compareTo> } declared in .compareTo' type=java.util.Comparator.compareTo>{ kotlin.TypeAliasesKt.Comparator.compareTo> } origin=null + $this: GET_VAR '$context_receiver_0: java.util.Comparator.compareTo>{ kotlin.TypeAliasesKt.Comparator.compareTo> } declared in .compareTo' type=java.util.Comparator.compareTo>{ kotlin.TypeAliasesKt.Comparator.compareTo> } origin=null p0: GET_VAR ': T of .compareTo declared in .compareTo' type=T of .compareTo origin=null p1: GET_VAR 'other: T of .compareTo declared in .compareTo' type=T of .compareTo origin=null PROPERTY name:min visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL ($receiver:.Pair., T of .>, _context_receiver_0:java.util.Comparator.>{ kotlin.TypeAliasesKt.Comparator.> }) returnType:T of . + FUN name: visibility:public modality:FINAL ($receiver:.Pair., T of .>, $context_receiver_0:java.util.Comparator.>{ kotlin.TypeAliasesKt.Comparator.> }) returnType:T of . correspondingProperty: PROPERTY name:min visibility:public modality:FINAL [val] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Pair., T of .> - VALUE_PARAMETER name:_context_receiver_0 index:0 type:java.util.Comparator.>{ kotlin.TypeAliasesKt.Comparator.> } + VALUE_PARAMETER name:$context_receiver_0 index:0 type:java.util.Comparator.>{ kotlin.TypeAliasesKt.Comparator.> } BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (_context_receiver_0: java.util.Comparator.>{ kotlin.TypeAliasesKt.Comparator.> }): T of . declared in ' + RETURN type=kotlin.Nothing from='public final fun ($context_receiver_0: java.util.Comparator.>{ kotlin.TypeAliasesKt.Comparator.> }): T of . declared in ' WHEN type=T of . origin=IF BRANCH if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT - arg0: CALL 'public final fun compareTo (_context_receiver_0: java.util.Comparator.compareTo>{ kotlin.TypeAliasesKt.Comparator.compareTo> }, other: T of .compareTo): kotlin.Int [operator,infix] declared in ' type=kotlin.Int origin=LT + arg0: CALL 'public final fun compareTo ($context_receiver_0: java.util.Comparator.compareTo>{ kotlin.TypeAliasesKt.Comparator.compareTo> }, other: T of .compareTo): kotlin.Int [operator,infix] declared in ' type=kotlin.Int origin=LT : T of . $receiver: CALL 'public final fun (): A of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null - _context_receiver_0: GET_VAR '_context_receiver_0: java.util.Comparator.>{ kotlin.TypeAliasesKt.Comparator.> } declared in .' type=java.util.Comparator.>{ kotlin.TypeAliasesKt.Comparator.> } origin=null + $context_receiver_0: GET_VAR '$context_receiver_0: java.util.Comparator.>{ kotlin.TypeAliasesKt.Comparator.> } declared in .' type=java.util.Comparator.>{ kotlin.TypeAliasesKt.Comparator.> } origin=null other: CALL 'public final fun (): B of .Pair declared in .Pair' type=T of . origin=GET_PROPERTY $this: GET_VAR ': .Pair., T of .> declared in .' type=.Pair., T of .> origin=null arg1: CONST Int type=kotlin.Int value=0 @@ -238,11 +238,11 @@ FILE fqName: fileName:/compareTo.kt $receiver: VALUE_PARAMETER name:$this$with type:java.util.Comparator BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' - CALL 'public final fun (_context_receiver_0: java.util.Comparator.>{ kotlin.TypeAliasesKt.Comparator.> }): T of . declared in ' type=kotlin.String origin=GET_PROPERTY + CALL 'public final fun ($context_receiver_0: java.util.Comparator.>{ kotlin.TypeAliasesKt.Comparator.> }): T of . declared in ' type=kotlin.String origin=GET_PROPERTY : kotlin.String $receiver: CONSTRUCTOR_CALL 'public constructor (first: A of .Pair, second: B of .Pair) [primary] declared in .Pair' type=.Pair origin=null : kotlin.String : kotlin.String first: CONST String type=kotlin.String value="OK" second: CONST String type=kotlin.String value="fail" - _context_receiver_0: GET_VAR '$this$with: java.util.Comparator declared in .box.' type=java.util.Comparator origin=null + $context_receiver_0: GET_VAR '$this$with: java.util.Comparator declared in .box.' type=java.util.Comparator origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt.txt index 8f3411c683d..5965505f41d 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt.txt @@ -60,14 +60,14 @@ data class Pair { } -infix operator fun T.compareTo(_context_receiver_0: Comparator, other: T): Int { - return _context_receiver_0.compare(p0 = , p1 = other) +infix operator fun T.compareTo($context_receiver_0: Comparator, other: T): Int { + return $context_receiver_0.compare(p0 = , p1 = other) } val Pair.min: T - get(_context_receiver_0: Comparator): T { + get($context_receiver_0: Comparator): T { return when { - less(arg0 = .().compareTo(_context_receiver_0 = _context_receiver_0, other = .()), arg1 = 0) -> .() + less(arg0 = .().compareTo($context_receiver_0 = $context_receiver_0, other = .()), arg1 = 0) -> .() else -> .() } } @@ -84,7 +84,7 @@ fun box(): String { } /*-> Comparator */ return with, String>(receiver = comparator, block = local fun Comparator.(): String { - return Pair(first = "OK", second = "fail").(_context_receiver_0 = $this$with) + return Pair(first = "OK", second = "fail").($context_receiver_0 = $this$with) } ) } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.fir.ir.txt index a41dc143fc1..7dbbdbe5e2f 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.fir.ir.txt @@ -30,16 +30,16 @@ FILE fqName: fileName:/dp.kt public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:dp visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.Int, _context_receiver_0:.View) returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.View) returnType:kotlin.Int correspondingProperty: PROPERTY name:dp visibility:public modality:FINAL [val] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.View + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.View BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (_context_receiver_0: .View): kotlin.Int declared in ' + RETURN type=kotlin.Nothing from='public final fun ($context_receiver_0: .View): kotlin.Int declared in ' CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MUL $this: CALL 'public final fun (): kotlin.Int declared in .View' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .View declared in .' type=.View origin=null + $this: GET_VAR '$context_receiver_0: .View declared in .' type=.View origin=null other: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY @@ -68,9 +68,9 @@ FILE fqName: fileName:/dp.kt VALUE_PARAMETER name:it index:0 type:kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): kotlin.Int declared in .box.' - CALL 'public final fun (_context_receiver_0: .View): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + CALL 'public final fun ($context_receiver_0: .View): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY $receiver: GET_VAR 'it: kotlin.Int declared in .box..' type=kotlin.Int origin=null - _context_receiver_0: GET_VAR '$this$with: .View declared in .box.' type=.View origin=null + $context_receiver_0: GET_VAR '$this$with: .View declared in .box.' type=.View origin=null arg1: CALL 'public final fun listOf (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List origin=null : kotlin.Int elements: VARARG type=kotlin.Array varargElementType=kotlin.Int diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.fir.kt.txt index 5a32cbb90f7..8da93b8b9d6 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.fir.kt.txt @@ -12,15 +12,15 @@ class View { } val Int.dp: Int - get(_context_receiver_0: View): Int { - return _context_receiver_0.().times(other = ) + get($context_receiver_0: View): Int { + return $context_receiver_0.().times(other = ) } fun box(): String { with(receiver = View(), block = local fun View.(): Nothing { when { EQEQ(arg0 = listOf(elements = [1, 2, 10]).map(transform = local fun (it: Int): Int { - return it.(_context_receiver_0 = $this$with) + return it.($context_receiver_0 = $this$with) } ), arg1 = listOf(elements = [42, 84, 420])) -> return "OK" } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.ir.txt index 27036eca7aa..4637f75728a 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.ir.txt @@ -30,16 +30,16 @@ FILE fqName: fileName:/dp.kt public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:dp visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.Int, _context_receiver_0:.View) returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.Int, $context_receiver_0:.View) returnType:kotlin.Int correspondingProperty: PROPERTY name:dp visibility:public modality:FINAL [val] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.View + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.View BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (_context_receiver_0: .View): kotlin.Int declared in ' + RETURN type=kotlin.Nothing from='public final fun ($context_receiver_0: .View): kotlin.Int declared in ' CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MUL $this: CALL 'public final fun (): kotlin.Int declared in .View' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .View declared in .' type=.View origin=null + $this: GET_VAR '$context_receiver_0: .View declared in .' type=.View origin=null other: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY @@ -68,9 +68,9 @@ FILE fqName: fileName:/dp.kt VALUE_PARAMETER name:it index:0 type:kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): kotlin.Int declared in .box.' - CALL 'public final fun (_context_receiver_0: .View): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY + CALL 'public final fun ($context_receiver_0: .View): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY $receiver: GET_VAR 'it: kotlin.Int declared in .box..' type=kotlin.Int origin=null - _context_receiver_0: GET_VAR '$this$with: .View declared in .box.' type=.View origin=null + $context_receiver_0: GET_VAR '$this$with: .View declared in .box.' type=.View origin=null arg1: CALL 'public final fun listOf (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List origin=null : kotlin.Int elements: VARARG type=kotlin.Array varargElementType=kotlin.Int diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.kt.txt index d1ac2e8dcc9..75a72bdbc6b 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/dp.kt.txt @@ -12,15 +12,15 @@ class View { } val Int.dp: Int - get(_context_receiver_0: View): Int { - return _context_receiver_0.().times(other = ) + get($context_receiver_0: View): Int { + return $context_receiver_0.().times(other = ) } fun box(): String { with(receiver = View(), block = local fun View.(): Nothing { when { EQEQ(arg0 = listOf(elements = [1, 2, 10]).map(transform = local fun (it: Int): Int { - return it.(_context_receiver_0 = $this$with) + return it.($context_receiver_0 = $this$with) } ), arg1 = listOf(elements = [42, 84, 420])) -> { // BLOCK return "OK" diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.fir.ir.txt index 2a7abf8bd12..6890387a551 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.fir.ir.txt @@ -78,17 +78,17 @@ FILE fqName: fileName:/functionalType.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:f visibility:public modality:FINAL ($receiver:.K, _context_receiver_0:.O, g:@[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f>) returnType:T of .f + FUN name:f visibility:public modality:FINAL ($receiver:.K, $context_receiver_0:.O, g:@[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f>) returnType:T of .f TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.K - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.O + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.O VALUE_PARAMETER name:g index:1 type:@[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun f (_context_receiver_0: .O, g: @[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f>): T of .f declared in ' + RETURN type=kotlin.Nothing from='public final fun f ($context_receiver_0: .O, g: @[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f>): T of .f declared in ' CALL 'public abstract fun invoke (p1: P1 of kotlin.Function3, p2: P2 of kotlin.Function3, p3: P3 of kotlin.Function3): R of kotlin.Function3 [operator] declared in kotlin.Function3' type=T of .f origin=INVOKE $this: GET_VAR 'g: @[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f> declared in .f' type=@[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR '_context_receiver_0: .O declared in .f' type=.O origin=null + p1: GET_VAR '$context_receiver_0: .O declared in .f' type=.O origin=null p2: GET_VAR ': .K declared in .f' type=.K origin=null p3: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Param' type=.Param origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String @@ -103,18 +103,18 @@ FILE fqName: fileName:/functionalType.kt $receiver: VALUE_PARAMETER name:$this$with type:.O BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' - CALL 'public final fun f (_context_receiver_0: .O, g: @[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f>): T of .f declared in ' type=kotlin.String origin=null + CALL 'public final fun f ($context_receiver_0: .O, g: @[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, T of .f>): T of .f declared in ' type=kotlin.String origin=null : kotlin.String $receiver: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .K' type=.K origin=null - _context_receiver_0: GET_VAR '$this$with: .O declared in .box.' type=.O origin=null + $context_receiver_0: GET_VAR '$this$with: .O declared in .box.' type=.O origin=null g: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function3<.O, .K, .Param, kotlin.String> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.K, _context_receiver_0:.O, it:.Param) returnType:kotlin.String + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.K, $context_receiver_0:.O, it:.Param) returnType:kotlin.String contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name:$this$f type:.K - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.O + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.O VALUE_PARAMETER name:it index:1 type:.Param BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (_context_receiver_0: .O, it: .Param): kotlin.String declared in .box.' + RETURN type=kotlin.Nothing from='local final fun ($context_receiver_0: .O, it: .Param): kotlin.String declared in .box.' CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS $this: CALL 'public final fun (): kotlin.String declared in .O' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR '$this$with: .O declared in .box.' type=.O origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.fir.kt.txt index 5dd11b64d67..01424488a25 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.fir.kt.txt @@ -33,13 +33,13 @@ class K { } -fun K.f(_context_receiver_0: O, g: @ExtensionFunctionType Function3): T { - return g.invoke(p1 = _context_receiver_0, p2 = , p3 = Param()) +fun K.f($context_receiver_0: O, g: @ExtensionFunctionType Function3): T { + return g.invoke(p1 = $context_receiver_0, p2 = , p3 = Param()) } fun box(): String { return with(receiver = O(), block = local fun O.(): String { - return K().f(_context_receiver_0 = $this$with, g = local fun K.(_context_receiver_0: O, it: Param): String { + return K().f($context_receiver_0 = $this$with, g = local fun K.($context_receiver_0: O, it: Param): String { return $this$with.().plus(other = $this$f.()) } ) diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.ir.txt index ba4609e7339..cf98a8fa859 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.ir.txt @@ -78,17 +78,17 @@ FILE fqName: fileName:/functionalType.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:f visibility:public modality:FINAL ($receiver:.K, _context_receiver_0:.O, g:@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.O, .K, .Param, T of .f>) returnType:T of .f + FUN name:f visibility:public modality:FINAL ($receiver:.K, $context_receiver_0:.O, g:@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.O, .K, .Param, T of .f>) returnType:T of .f TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.K - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.O + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.O VALUE_PARAMETER name:g index:1 type:@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.O, .K, .Param, T of .f> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun f (_context_receiver_0: .O, g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.O, .K, .Param, T of .f>): T of .f declared in ' + RETURN type=kotlin.Nothing from='public final fun f ($context_receiver_0: .O, g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.O, .K, .Param, T of .f>): T of .f declared in ' CALL 'public abstract fun invoke (p1: P1 of kotlin.Function3, p2: P2 of kotlin.Function3, p3: P3 of kotlin.Function3): R of kotlin.Function3 [operator] declared in kotlin.Function3' type=T of .f origin=INVOKE $this: GET_VAR 'g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.O, .K, .Param, T of .f> declared in .f' type=@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.O, .K, .Param, T of .f> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR '_context_receiver_0: .O declared in .f' type=.O origin=null + p1: GET_VAR '$context_receiver_0: .O declared in .f' type=.O origin=null p2: GET_VAR ': .K declared in .f' type=.K origin=null p3: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Param' type=.Param origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String @@ -103,18 +103,18 @@ FILE fqName: fileName:/functionalType.kt $receiver: VALUE_PARAMETER name:$this$with type:.O BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' - CALL 'public final fun f (_context_receiver_0: .O, g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.O, .K, .Param, T of .f>): T of .f declared in ' type=kotlin.String origin=null + CALL 'public final fun f ($context_receiver_0: .O, g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.O, .K, .Param, T of .f>): T of .f declared in ' type=kotlin.String origin=null : kotlin.String $receiver: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .K' type=.K origin=null - _context_receiver_0: GET_VAR '$this$with: .O declared in .box.' type=.O origin=null + $context_receiver_0: GET_VAR '$this$with: .O declared in .box.' type=.O origin=null g: FUN_EXPR type=@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.O, .K, .Param, kotlin.String> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.K, _context_receiver_0:.O, it:.Param) returnType:kotlin.String + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.K, $context_receiver_0:.O, it:.Param) returnType:kotlin.String contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name:$this$f type:.K - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.O + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.O VALUE_PARAMETER name:it index:1 type:.Param BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (_context_receiver_0: .O, it: .Param): kotlin.String declared in .box.' + RETURN type=kotlin.Nothing from='local final fun ($context_receiver_0: .O, it: .Param): kotlin.String declared in .box.' CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS $this: CALL 'public final fun (): kotlin.String declared in .O' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR '$this$with: .O declared in .box.' type=.O origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.kt.txt index 6d40259b705..c79a9260272 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/functionalType.kt.txt @@ -33,13 +33,13 @@ class K { } -fun K.f(_context_receiver_0: O, g: @ExtensionFunctionType @ContextFunctionTypeParams(count = 1) Function3): T { - return g.invoke(p1 = _context_receiver_0, p2 = , p3 = Param()) +fun K.f($context_receiver_0: O, g: @ExtensionFunctionType @ContextFunctionTypeParams(count = 1) Function3): T { + return g.invoke(p1 = $context_receiver_0, p2 = , p3 = Param()) } fun box(): String { return with(receiver = O(), block = local fun O.(): String { - return K().f(_context_receiver_0 = $this$with, g = local fun K.(_context_receiver_0: O, it: Param): String { + return K().f($context_receiver_0 = $this$with, g = local fun K.($context_receiver_0: O, it: Param): String { return $this$with.().plus(other = $this$f.()) } ) diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.fir.ir.txt index e7347bdd7f5..90c099a286e 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.fir.ir.txt @@ -135,19 +135,19 @@ FILE fqName: fileName:/monoidSum.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .Monoid $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:sum visibility:public modality:FINAL ($receiver:kotlin.collections.List.sum>, _context_receiver_0:.Monoid.sum>) returnType:T of .sum + FUN name:sum visibility:public modality:FINAL ($receiver:kotlin.collections.List.sum>, $context_receiver_0:.Monoid.sum>) returnType:T of .sum TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.sum> - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Monoid.sum> + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Monoid.sum> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun sum (_context_receiver_0: .Monoid.sum>): T of .sum declared in ' + RETURN type=kotlin.Nothing from='public final fun sum ($context_receiver_0: .Monoid.sum>): T of .sum declared in ' CALL 'public final fun fold (initial: R of kotlin.collections.CollectionsKt.fold, operation: kotlin.Function2): R of kotlin.collections.CollectionsKt.fold [inline] declared in kotlin.collections.CollectionsKt' type=T of .sum origin=null : T of .sum : T of .sum $receiver: GET_VAR ': kotlin.collections.List.sum> declared in .sum' type=kotlin.collections.List.sum> origin=null initial: CALL 'public abstract fun (): T of .Monoid declared in .Monoid' type=T of .sum origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .Monoid.sum> declared in .sum' type=.Monoid.sum> origin=null + $this: GET_VAR '$context_receiver_0: .Monoid.sum> declared in .sum' type=.Monoid.sum> origin=null operation: FUN_EXPR type=kotlin.Function2.sum, T of .sum, T of .sum> origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (acc:T of .sum, e:T of .sum) returnType:T of .sum VALUE_PARAMETER name:acc index:0 type:T of .sum @@ -155,7 +155,7 @@ FILE fqName: fileName:/monoidSum.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (acc: T of .sum, e: T of .sum): T of .sum declared in .sum' CALL 'public abstract fun combine (other: T of .Monoid): T of .Monoid [fake_override,infix] declared in .Monoid' type=T of .sum origin=null - $this: GET_VAR '_context_receiver_0: .Monoid.sum> declared in .sum' type=.Monoid.sum> origin=null + $this: GET_VAR '$context_receiver_0: .Monoid.sum> declared in .sum' type=.Monoid.sum> origin=null $receiver: GET_VAR 'acc: T of .sum declared in .sum.' type=T of .sum origin=null other: GET_VAR 'e: T of .sum declared in .sum.' type=T of .sum origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String @@ -170,7 +170,7 @@ FILE fqName: fileName:/monoidSum.kt $receiver: VALUE_PARAMETER name:$this$with type:.IntMonoid BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .box' - CALL 'public final fun sum (_context_receiver_0: .Monoid.sum>): T of .sum declared in ' type=kotlin.Int origin=null + CALL 'public final fun sum ($context_receiver_0: .Monoid.sum>): T of .sum declared in ' type=kotlin.Int origin=null : kotlin.Int $receiver: CALL 'public final fun listOf (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List origin=null : kotlin.Int @@ -178,7 +178,7 @@ FILE fqName: fileName:/monoidSum.kt CONST Int type=kotlin.Int value=1 CONST Int type=kotlin.Int value=2 CONST Int type=kotlin.Int value=3 - _context_receiver_0: GET_VAR '$this$with: .IntMonoid declared in .box.' type=.IntMonoid origin=null + $context_receiver_0: GET_VAR '$this$with: .IntMonoid declared in .box.' type=.IntMonoid origin=null RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' 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.String origin=null : .StringMonoid @@ -189,11 +189,11 @@ FILE fqName: fileName:/monoidSum.kt $receiver: VALUE_PARAMETER name:$this$with type:.StringMonoid BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' - CALL 'public final fun sum (_context_receiver_0: .Monoid.sum>): T of .sum declared in ' type=kotlin.String origin=null + CALL 'public final fun sum ($context_receiver_0: .Monoid.sum>): T of .sum declared in ' type=kotlin.String origin=null : kotlin.String $receiver: CALL 'public final fun listOf (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List origin=null : kotlin.String elements: VARARG type=kotlin.Array varargElementType=kotlin.String CONST String type=kotlin.String value="O" CONST String type=kotlin.String value="K" - _context_receiver_0: GET_VAR '$this$with: .StringMonoid declared in .box.' type=.StringMonoid origin=null + $context_receiver_0: GET_VAR '$this$with: .StringMonoid declared in .box.' type=.StringMonoid origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.fir.kt.txt index 4fe6b98b2c3..57680375178 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.fir.kt.txt @@ -43,20 +43,20 @@ object StringMonoid : Monoid { } -fun List.sum(_context_receiver_0: Monoid): T { - return .fold(initial = _context_receiver_0.(), operation = local fun (acc: T, e: T): T { - return (_context_receiver_0, acc).combine(other = e) +fun List.sum($context_receiver_0: Monoid): T { + return .fold(initial = $context_receiver_0.(), operation = local fun (acc: T, e: T): T { + return ($context_receiver_0, acc).combine(other = e) } ) } fun box(): String { with(receiver = IntMonoid, block = local fun IntMonoid.(): Int { - return listOf(elements = [1, 2, 3]).sum(_context_receiver_0 = $this$with) + return listOf(elements = [1, 2, 3]).sum($context_receiver_0 = $this$with) } ) /*~> Unit */ return with(receiver = StringMonoid, block = local fun StringMonoid.(): String { - return listOf(elements = ["O", "K"]).sum(_context_receiver_0 = $this$with) + return listOf(elements = ["O", "K"]).sum($context_receiver_0 = $this$with) } ) } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.ir.txt index 467fc89907e..f67edf80d7e 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.ir.txt @@ -135,19 +135,19 @@ FILE fqName: fileName:/monoidSum.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .Monoid $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:sum visibility:public modality:FINAL ($receiver:kotlin.collections.List.sum>, _context_receiver_0:.Monoid.sum>) returnType:T of .sum + FUN name:sum visibility:public modality:FINAL ($receiver:kotlin.collections.List.sum>, $context_receiver_0:.Monoid.sum>) returnType:T of .sum TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.sum> - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Monoid.sum> + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Monoid.sum> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun sum (_context_receiver_0: .Monoid.sum>): T of .sum declared in ' + RETURN type=kotlin.Nothing from='public final fun sum ($context_receiver_0: .Monoid.sum>): T of .sum declared in ' CALL 'public final fun fold (initial: R of kotlin.collections.CollectionsKt.fold, operation: kotlin.Function2<@[ParameterName(name = 'acc')] R of kotlin.collections.CollectionsKt.fold, T of kotlin.collections.CollectionsKt.fold, R of kotlin.collections.CollectionsKt.fold>): R of kotlin.collections.CollectionsKt.fold [inline] declared in kotlin.collections.CollectionsKt' type=T of .sum origin=null : T of .sum : T of .sum $receiver: GET_VAR ': kotlin.collections.List.sum> declared in .sum' type=kotlin.collections.List.sum> origin=null initial: CALL 'public abstract fun (): T of .Monoid declared in .Monoid' type=T of .sum origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .Monoid.sum> declared in .sum' type=.Monoid.sum> origin=null + $this: GET_VAR '$context_receiver_0: .Monoid.sum> declared in .sum' type=.Monoid.sum> origin=null operation: FUN_EXPR type=kotlin.Function2<@[ParameterName(name = 'acc')] T of .sum, T of .sum, T of .sum> origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (acc:T of .sum, e:T of .sum) returnType:T of .sum VALUE_PARAMETER name:acc index:0 type:T of .sum @@ -155,7 +155,7 @@ FILE fqName: fileName:/monoidSum.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (acc: T of .sum, e: T of .sum): T of .sum declared in .sum' CALL 'public abstract fun combine (other: T of .Monoid): T of .Monoid [fake_override,infix] declared in .Monoid' type=T of .sum origin=null - $this: GET_VAR '_context_receiver_0: .Monoid.sum> declared in .sum' type=.Monoid.sum> origin=null + $this: GET_VAR '$context_receiver_0: .Monoid.sum> declared in .sum' type=.Monoid.sum> origin=null $receiver: GET_VAR 'acc: T of .sum declared in .sum.' type=T of .sum origin=null other: GET_VAR 'e: T of .sum declared in .sum.' type=T of .sum origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String @@ -170,7 +170,7 @@ FILE fqName: fileName:/monoidSum.kt $receiver: VALUE_PARAMETER name:$this$with type:.IntMonoid BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .box' - CALL 'public final fun sum (_context_receiver_0: .Monoid.sum>): T of .sum declared in ' type=kotlin.Int origin=null + CALL 'public final fun sum ($context_receiver_0: .Monoid.sum>): T of .sum declared in ' type=kotlin.Int origin=null : kotlin.Int $receiver: CALL 'public final fun listOf (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List origin=null : kotlin.Int @@ -178,7 +178,7 @@ FILE fqName: fileName:/monoidSum.kt CONST Int type=kotlin.Int value=1 CONST Int type=kotlin.Int value=2 CONST Int type=kotlin.Int value=3 - _context_receiver_0: GET_VAR '$this$with: .IntMonoid declared in .box.' type=.IntMonoid origin=null + $context_receiver_0: GET_VAR '$this$with: .IntMonoid declared in .box.' type=.IntMonoid origin=null RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' 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.String origin=null : .StringMonoid @@ -189,11 +189,11 @@ FILE fqName: fileName:/monoidSum.kt $receiver: VALUE_PARAMETER name:$this$with type:.StringMonoid BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' - CALL 'public final fun sum (_context_receiver_0: .Monoid.sum>): T of .sum declared in ' type=kotlin.String origin=null + CALL 'public final fun sum ($context_receiver_0: .Monoid.sum>): T of .sum declared in ' type=kotlin.String origin=null : kotlin.String $receiver: CALL 'public final fun listOf (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List origin=null : kotlin.String elements: VARARG type=kotlin.Array varargElementType=kotlin.String CONST String type=kotlin.String value="O" CONST String type=kotlin.String value="K" - _context_receiver_0: GET_VAR '$this$with: .StringMonoid declared in .box.' type=.StringMonoid origin=null + $context_receiver_0: GET_VAR '$this$with: .StringMonoid declared in .box.' type=.StringMonoid origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.kt.txt index 4fe6b98b2c3..57680375178 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/monoidSum.kt.txt @@ -43,20 +43,20 @@ object StringMonoid : Monoid { } -fun List.sum(_context_receiver_0: Monoid): T { - return .fold(initial = _context_receiver_0.(), operation = local fun (acc: T, e: T): T { - return (_context_receiver_0, acc).combine(other = e) +fun List.sum($context_receiver_0: Monoid): T { + return .fold(initial = $context_receiver_0.(), operation = local fun (acc: T, e: T): T { + return ($context_receiver_0, acc).combine(other = e) } ) } fun box(): String { with(receiver = IntMonoid, block = local fun IntMonoid.(): Int { - return listOf(elements = [1, 2, 3]).sum(_context_receiver_0 = $this$with) + return listOf(elements = [1, 2, 3]).sum($context_receiver_0 = $this$with) } ) /*~> Unit */ return with(receiver = StringMonoid, block = local fun StringMonoid.(): String { - return listOf(elements = ["O", "K"]).sum(_context_receiver_0 = $this$with) + return listOf(elements = ["O", "K"]).sum($context_receiver_0 = $this$with) } ) } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/function.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/function.ir.txt index 2cefb5b030d..c5f438be05e 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/function.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/function.ir.txt @@ -29,13 +29,13 @@ FILE fqName: fileName:/function.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:foo visibility:public modality:FINAL <> (_context_receiver_0:.C) returnType:kotlin.Unit + FUN name:foo visibility:public modality:FINAL <> ($context_receiver_0:.C) returnType:kotlin.Unit contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .C declared in .foo' type=.C origin=null + $this: GET_VAR '$context_receiver_0: .C declared in .foo' type=.C origin=null FUN name:bar visibility:public modality:FINAL <> (c:.C) returnType:kotlin.Unit VALUE_PARAMETER name:c index:0 type:.C BLOCK_BODY @@ -47,5 +47,5 @@ FILE fqName: fileName:/function.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.C) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name:$this$with type:.C BLOCK_BODY - CALL 'public final fun foo (_context_receiver_0: .C): kotlin.Unit declared in ' type=kotlin.Unit origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .bar.' type=.C origin=null + CALL 'public final fun foo ($context_receiver_0: .C): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .bar.' type=.C origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/function.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/function.kt.txt index a2b63fa51c5..66c81a67956 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/function.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/function.kt.txt @@ -11,13 +11,13 @@ class C { } -fun foo(_context_receiver_0: C) { - _context_receiver_0.() /*~> Unit */ +fun foo($context_receiver_0: C) { + $context_receiver_0.() /*~> Unit */ } fun bar(c: C) { with(receiver = c, block = local fun C.() { - foo(_context_receiver_0 = $this$with) + foo($context_receiver_0 = $this$with) } ) } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.fir.ir.txt index ea1bd615300..8a9b2b3b4b7 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.fir.ir.txt @@ -78,52 +78,52 @@ FILE fqName: fileName:/functionalType.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:f1 visibility:public modality:FINAL <> ($receiver:.R, _context_receiver_0:.C, g:@[ExtensionFunctionType] kotlin.Function3<.C, .R, .Param, kotlin.Unit>) returnType:kotlin.Unit + FUN name:f1 visibility:public modality:FINAL <> ($receiver:.R, $context_receiver_0:.C, g:@[ExtensionFunctionType] kotlin.Function3<.C, .R, .Param, kotlin.Unit>) returnType:kotlin.Unit contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.R - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C VALUE_PARAMETER name:g index:1 type:@[ExtensionFunctionType] kotlin.Function3<.C, .R, .Param, kotlin.Unit> BLOCK_BODY CALL 'public abstract fun invoke (p1: P1 of kotlin.Function3, p2: P2 of kotlin.Function3, p3: P3 of kotlin.Function3): R of kotlin.Function3 [operator] declared in kotlin.Function3' type=kotlin.Unit origin=INVOKE $this: GET_VAR 'g: @[ExtensionFunctionType] kotlin.Function3<.C, .R, .Param, kotlin.Unit> declared in .f1' type=@[ExtensionFunctionType] kotlin.Function3<.C, .R, .Param, kotlin.Unit> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR '_context_receiver_0: .C declared in .f1' type=.C origin=null + p1: GET_VAR '$context_receiver_0: .C declared in .f1' type=.C origin=null p2: GET_VAR ': .R declared in .f1' type=.R origin=null p3: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Param' type=.Param origin=null - FUN name:f2 visibility:public modality:FINAL <> (_context_receiver_0:.C, g:kotlin.Function2<.C, .Param, kotlin.Unit>) returnType:kotlin.Unit + FUN name:f2 visibility:public modality:FINAL <> ($context_receiver_0:.C, g:kotlin.Function2<.C, .Param, kotlin.Unit>) returnType:kotlin.Unit contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C VALUE_PARAMETER name:g index:1 type:kotlin.Function2<.C, .Param, kotlin.Unit> BLOCK_BODY CALL 'public abstract fun invoke (p1: P1 of kotlin.Function2, p2: P2 of kotlin.Function2): R of kotlin.Function2 [operator] declared in kotlin.Function2' type=kotlin.Unit origin=INVOKE $this: GET_VAR 'g: kotlin.Function2<.C, .Param, kotlin.Unit> declared in .f2' type=kotlin.Function2<.C, .Param, kotlin.Unit> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR '_context_receiver_0: .C declared in .f2' type=.C origin=null + p1: GET_VAR '$context_receiver_0: .C declared in .f2' type=.C origin=null p2: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Param' type=.Param origin=null - FUN name:f3 visibility:public modality:FINAL <> ($receiver:.R, _context_receiver_0:.C, g:@[ExtensionFunctionType] kotlin.Function2<.C, .R, kotlin.Unit>) returnType:kotlin.Unit + FUN name:f3 visibility:public modality:FINAL <> ($receiver:.R, $context_receiver_0:.C, g:@[ExtensionFunctionType] kotlin.Function2<.C, .R, kotlin.Unit>) returnType:kotlin.Unit contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.R - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C VALUE_PARAMETER name:g index:1 type:@[ExtensionFunctionType] kotlin.Function2<.C, .R, kotlin.Unit> BLOCK_BODY CALL 'public abstract fun invoke (p1: P1 of kotlin.Function2, p2: P2 of kotlin.Function2): R of kotlin.Function2 [operator] declared in kotlin.Function2' type=kotlin.Unit origin=INVOKE $this: GET_VAR 'g: @[ExtensionFunctionType] kotlin.Function2<.C, .R, kotlin.Unit> declared in .f3' type=@[ExtensionFunctionType] kotlin.Function2<.C, .R, kotlin.Unit> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR '_context_receiver_0: .C declared in .f3' type=.C origin=null + p1: GET_VAR '$context_receiver_0: .C declared in .f3' type=.C origin=null p2: GET_VAR ': .R declared in .f3' type=.R origin=null - FUN name:f4 visibility:public modality:FINAL <> (_context_receiver_0:.C, g:kotlin.Function1<.C, kotlin.Unit>) returnType:kotlin.Unit + FUN name:f4 visibility:public modality:FINAL <> ($context_receiver_0:.C, g:kotlin.Function1<.C, kotlin.Unit>) returnType:kotlin.Unit contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C VALUE_PARAMETER name:g index:1 type:kotlin.Function1<.C, kotlin.Unit> BLOCK_BODY CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 [operator] declared in kotlin.Function1' type=kotlin.Unit origin=INVOKE $this: GET_VAR 'g: kotlin.Function1<.C, kotlin.Unit> declared in .f4' type=kotlin.Function1<.C, kotlin.Unit> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR '_context_receiver_0: .C declared in .f4' type=.C origin=null + p1: GET_VAR '$context_receiver_0: .C declared in .f4' type=.C origin=null FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:lf1 type:@[ExtensionFunctionType] kotlin.Function3<.C, .R, .Param, kotlin.Unit> [val] FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function3<.C, .R, .Param, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, _context_receiver_0:.C, :.Param) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, $context_receiver_0:.C, :.Param) returnType:kotlin.Unit contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.R - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C VALUE_PARAMETER UNDERSCORE_PARAMETER name: index:1 type:.Param BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit @@ -131,39 +131,39 @@ FILE fqName: fileName:/functionalType.kt $this: GET_VAR ': .R declared in .test.' type=.R origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .C declared in .test.' type=.C origin=null + $this: GET_VAR '$context_receiver_0: .C declared in .test.' type=.C origin=null VAR name:lf2 type:kotlin.Function2<.C, .Param, kotlin.Unit> [val] FUN_EXPR type=kotlin.Function2<.C, .Param, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (_context_receiver_0:.C, :.Param) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($context_receiver_0:.C, :.Param) returnType:kotlin.Unit contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C VALUE_PARAMETER UNDERSCORE_PARAMETER name: index:1 type:.Param BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .C declared in .test.' type=.C origin=null + $this: GET_VAR '$context_receiver_0: .C declared in .test.' type=.C origin=null VAR name:lf3 type:@[ExtensionFunctionType] kotlin.Function2<.C, .R, kotlin.Unit> [val] FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function2<.C, .R, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, _context_receiver_0:.C) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, $context_receiver_0:.C) returnType:kotlin.Unit contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.R - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .R' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .R declared in .test.' type=.R origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .C declared in .test.' type=.C origin=null + $this: GET_VAR '$context_receiver_0: .C declared in .test.' type=.C origin=null VAR name:lf4 type:kotlin.Function1<.C, kotlin.Unit> [val] FUN_EXPR type=kotlin.Function1<.C, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (_context_receiver_0:.C) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($context_receiver_0:.C) returnType:kotlin.Unit contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .C declared in .test.' type=.C origin=null + $this: GET_VAR '$context_receiver_0: .C declared in .test.' type=.C origin=null 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 : .C : kotlin.Unit @@ -180,18 +180,18 @@ FILE fqName: fileName:/functionalType.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name:$this$with type:.R BLOCK_BODY - CALL 'public final fun f1 (_context_receiver_0: .C, g: @[ExtensionFunctionType] kotlin.Function3<.C, .R, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun f1 ($context_receiver_0: .C, g: @[ExtensionFunctionType] kotlin.Function3<.C, .R, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR '$this$with: .R declared in .test..' type=.R origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null g: GET_VAR 'val lf1: @[ExtensionFunctionType] kotlin.Function3<.C, .R, .Param, kotlin.Unit> [val] declared in .test' type=@[ExtensionFunctionType] kotlin.Function3<.C, .R, .Param, kotlin.Unit> origin=null - CALL 'public final fun f1 (_context_receiver_0: .C, g: @[ExtensionFunctionType] kotlin.Function3<.C, .R, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun f1 ($context_receiver_0: .C, g: @[ExtensionFunctionType] kotlin.Function3<.C, .R, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR '$this$with: .R declared in .test..' type=.R origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null g: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function3<.C, .R, .Param, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, _context_receiver_0:.C, :.Param) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, $context_receiver_0:.C, :.Param) returnType:kotlin.Unit contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name:$this$f1 type:.R - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C VALUE_PARAMETER UNDERSCORE_PARAMETER name: index:1 type:.Param BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit @@ -200,32 +200,32 @@ FILE fqName: fileName:/functionalType.kt TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null - CALL 'public final fun f2 (_context_receiver_0: .C, g: kotlin.Function2<.C, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null + CALL 'public final fun f2 ($context_receiver_0: .C, g: kotlin.Function2<.C, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null g: GET_VAR 'val lf2: kotlin.Function2<.C, .Param, kotlin.Unit> [val] declared in .test' type=kotlin.Function2<.C, .Param, kotlin.Unit> origin=null - CALL 'public final fun f2 (_context_receiver_0: .C, g: kotlin.Function2<.C, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null + CALL 'public final fun f2 ($context_receiver_0: .C, g: kotlin.Function2<.C, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null g: FUN_EXPR type=kotlin.Function2<.C, .Param, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (_context_receiver_0:.C, :.Param) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($context_receiver_0:.C, :.Param) returnType:kotlin.Unit contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C VALUE_PARAMETER UNDERSCORE_PARAMETER name: index:1 type:.Param BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null - CALL 'public final fun f3 (_context_receiver_0: .C, g: @[ExtensionFunctionType] kotlin.Function2<.C, .R, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun f3 ($context_receiver_0: .C, g: @[ExtensionFunctionType] kotlin.Function2<.C, .R, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR '$this$with: .R declared in .test..' type=.R origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null g: GET_VAR 'val lf3: @[ExtensionFunctionType] kotlin.Function2<.C, .R, kotlin.Unit> [val] declared in .test' type=@[ExtensionFunctionType] kotlin.Function2<.C, .R, kotlin.Unit> origin=null - CALL 'public final fun f3 (_context_receiver_0: .C, g: @[ExtensionFunctionType] kotlin.Function2<.C, .R, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun f3 ($context_receiver_0: .C, g: @[ExtensionFunctionType] kotlin.Function2<.C, .R, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR '$this$with: .R declared in .test..' type=.R origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null g: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function2<.C, .R, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, _context_receiver_0:.C) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, $context_receiver_0:.C) returnType:kotlin.Unit contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name:$this$f3 type:.R - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .R' type=kotlin.Int origin=GET_PROPERTY @@ -233,15 +233,15 @@ FILE fqName: fileName:/functionalType.kt TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null - CALL 'public final fun f4 (_context_receiver_0: .C, g: kotlin.Function1<.C, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null + CALL 'public final fun f4 ($context_receiver_0: .C, g: kotlin.Function1<.C, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null g: GET_VAR 'val lf4: kotlin.Function1<.C, kotlin.Unit> [val] declared in .test' type=kotlin.Function1<.C, kotlin.Unit> origin=null - CALL 'public final fun f4 (_context_receiver_0: .C, g: kotlin.Function1<.C, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null + CALL 'public final fun f4 ($context_receiver_0: .C, g: kotlin.Function1<.C, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null g: FUN_EXPR type=kotlin.Function1<.C, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (_context_receiver_0:.C) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($context_receiver_0:.C) returnType:kotlin.Unit contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.fir.kt.txt index f8ab7ef373e..c53c37b1ff5 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.fir.kt.txt @@ -33,62 +33,62 @@ class R { } -fun R.f1(_context_receiver_0: C, g: @ExtensionFunctionType Function3) { - g.invoke(p1 = _context_receiver_0, p2 = , p3 = Param()) +fun R.f1($context_receiver_0: C, g: @ExtensionFunctionType Function3) { + g.invoke(p1 = $context_receiver_0, p2 = , p3 = Param()) } -fun f2(_context_receiver_0: C, g: Function2) { - g.invoke(p1 = _context_receiver_0, p2 = Param()) +fun f2($context_receiver_0: C, g: Function2) { + g.invoke(p1 = $context_receiver_0, p2 = Param()) } -fun R.f3(_context_receiver_0: C, g: @ExtensionFunctionType Function2) { - g.invoke(p1 = _context_receiver_0, p2 = ) +fun R.f3($context_receiver_0: C, g: @ExtensionFunctionType Function2) { + g.invoke(p1 = $context_receiver_0, p2 = ) } -fun f4(_context_receiver_0: C, g: Function1) { - g.invoke(p1 = _context_receiver_0) +fun f4($context_receiver_0: C, g: Function1) { + g.invoke(p1 = $context_receiver_0) } fun test() { - val lf1: @ExtensionFunctionType Function3 = local fun R.(_context_receiver_0: C, : Param) { + val lf1: @ExtensionFunctionType Function3 = local fun R.($context_receiver_0: C, : Param) { .() /*~> Unit */ - _context_receiver_0.() /*~> Unit */ + $context_receiver_0.() /*~> Unit */ } - val lf2: Function2 = local fun (_context_receiver_0: C, : Param) { - _context_receiver_0.() /*~> Unit */ + val lf2: Function2 = local fun ($context_receiver_0: C, : Param) { + $context_receiver_0.() /*~> Unit */ } - val lf3: @ExtensionFunctionType Function2 = local fun R.(_context_receiver_0: C) { + val lf3: @ExtensionFunctionType Function2 = local fun R.($context_receiver_0: C) { .() /*~> Unit */ - _context_receiver_0.() /*~> Unit */ + $context_receiver_0.() /*~> Unit */ } - val lf4: Function1 = local fun (_context_receiver_0: C) { - _context_receiver_0.() /*~> Unit */ + val lf4: Function1 = local fun ($context_receiver_0: C) { + $context_receiver_0.() /*~> Unit */ } with(receiver = C(), block = local fun C.() { with(receiver = R(), block = local fun R.() { - $this$with.f1(_context_receiver_0 = $this$with, g = lf1) - $this$with.f1(_context_receiver_0 = $this$with, g = local fun R.(_context_receiver_0: C, : Param) { + $this$with.f1($context_receiver_0 = $this$with, g = lf1) + $this$with.f1($context_receiver_0 = $this$with, g = local fun R.($context_receiver_0: C, : Param) { $this$f1.() /*~> Unit */ $this$with.() /*~> Unit */ } ) - f2(_context_receiver_0 = $this$with, g = lf2) - f2(_context_receiver_0 = $this$with, g = local fun (_context_receiver_0: C, : Param) { + f2($context_receiver_0 = $this$with, g = lf2) + f2($context_receiver_0 = $this$with, g = local fun ($context_receiver_0: C, : Param) { $this$with.() /*~> Unit */ } ) - $this$with.f3(_context_receiver_0 = $this$with, g = lf3) - $this$with.f3(_context_receiver_0 = $this$with, g = local fun R.(_context_receiver_0: C) { + $this$with.f3($context_receiver_0 = $this$with, g = lf3) + $this$with.f3($context_receiver_0 = $this$with, g = local fun R.($context_receiver_0: C) { $this$f3.() /*~> Unit */ $this$with.() /*~> Unit */ } ) - f4(_context_receiver_0 = $this$with, g = lf4) - f4(_context_receiver_0 = $this$with, g = local fun (_context_receiver_0: C) { + f4($context_receiver_0 = $this$with, g = lf4) + f4($context_receiver_0 = $this$with, g = local fun ($context_receiver_0: C) { $this$with.() /*~> Unit */ } ) diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.ir.txt index 62a241aa1da..6b457700dbf 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.ir.txt @@ -78,52 +78,52 @@ FILE fqName: fileName:/functionalType.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:f1 visibility:public modality:FINAL <> ($receiver:.R, _context_receiver_0:.C, g:@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.C, .R, .Param, kotlin.Unit>) returnType:kotlin.Unit + FUN name:f1 visibility:public modality:FINAL <> ($receiver:.R, $context_receiver_0:.C, g:@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.C, .R, .Param, kotlin.Unit>) returnType:kotlin.Unit contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.R - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C VALUE_PARAMETER name:g index:1 type:@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.C, .R, .Param, kotlin.Unit> BLOCK_BODY CALL 'public abstract fun invoke (p1: P1 of kotlin.Function3, p2: P2 of kotlin.Function3, p3: P3 of kotlin.Function3): R of kotlin.Function3 [operator] declared in kotlin.Function3' type=kotlin.Unit origin=INVOKE $this: GET_VAR 'g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.C, .R, .Param, kotlin.Unit> declared in .f1' type=@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.C, .R, .Param, kotlin.Unit> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR '_context_receiver_0: .C declared in .f1' type=.C origin=null + p1: GET_VAR '$context_receiver_0: .C declared in .f1' type=.C origin=null p2: GET_VAR ': .R declared in .f1' type=.R origin=null p3: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Param' type=.Param origin=null - FUN name:f2 visibility:public modality:FINAL <> (_context_receiver_0:.C, g:@[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .Param, kotlin.Unit>) returnType:kotlin.Unit + FUN name:f2 visibility:public modality:FINAL <> ($context_receiver_0:.C, g:@[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .Param, kotlin.Unit>) returnType:kotlin.Unit contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C VALUE_PARAMETER name:g index:1 type:@[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .Param, kotlin.Unit> BLOCK_BODY CALL 'public abstract fun invoke (p1: P1 of kotlin.Function2, p2: P2 of kotlin.Function2): R of kotlin.Function2 [operator] declared in kotlin.Function2' type=kotlin.Unit origin=INVOKE $this: GET_VAR 'g: @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .Param, kotlin.Unit> declared in .f2' type=@[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .Param, kotlin.Unit> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR '_context_receiver_0: .C declared in .f2' type=.C origin=null + p1: GET_VAR '$context_receiver_0: .C declared in .f2' type=.C origin=null p2: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Param' type=.Param origin=null - FUN name:f3 visibility:public modality:FINAL <> ($receiver:.R, _context_receiver_0:.C, g:@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .R, kotlin.Unit>) returnType:kotlin.Unit + FUN name:f3 visibility:public modality:FINAL <> ($receiver:.R, $context_receiver_0:.C, g:@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .R, kotlin.Unit>) returnType:kotlin.Unit contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.R - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C VALUE_PARAMETER name:g index:1 type:@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .R, kotlin.Unit> BLOCK_BODY CALL 'public abstract fun invoke (p1: P1 of kotlin.Function2, p2: P2 of kotlin.Function2): R of kotlin.Function2 [operator] declared in kotlin.Function2' type=kotlin.Unit origin=INVOKE $this: GET_VAR 'g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .R, kotlin.Unit> declared in .f3' type=@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .R, kotlin.Unit> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR '_context_receiver_0: .C declared in .f3' type=.C origin=null + p1: GET_VAR '$context_receiver_0: .C declared in .f3' type=.C origin=null p2: GET_VAR ': .R declared in .f3' type=.R origin=null - FUN name:f4 visibility:public modality:FINAL <> (_context_receiver_0:.C, g:@[ContextFunctionTypeParams(count = '1')] kotlin.Function1<.C, kotlin.Unit>) returnType:kotlin.Unit + FUN name:f4 visibility:public modality:FINAL <> ($context_receiver_0:.C, g:@[ContextFunctionTypeParams(count = '1')] kotlin.Function1<.C, kotlin.Unit>) returnType:kotlin.Unit contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C VALUE_PARAMETER name:g index:1 type:@[ContextFunctionTypeParams(count = '1')] kotlin.Function1<.C, kotlin.Unit> BLOCK_BODY CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 [operator] declared in kotlin.Function1' type=kotlin.Unit origin=INVOKE $this: GET_VAR 'g: @[ContextFunctionTypeParams(count = '1')] kotlin.Function1<.C, kotlin.Unit> declared in .f4' type=@[ContextFunctionTypeParams(count = '1')] kotlin.Function1<.C, kotlin.Unit> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR '_context_receiver_0: .C declared in .f4' type=.C origin=null + p1: GET_VAR '$context_receiver_0: .C declared in .f4' type=.C origin=null FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:lf1 type:@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.C, .R, .Param, kotlin.Unit> [val] FUN_EXPR type=@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.C, .R, .Param, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, _context_receiver_0:.C, :.Param) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, $context_receiver_0:.C, :.Param) returnType:kotlin.Unit contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name:$this$null type:.R - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C VALUE_PARAMETER UNDERSCORE_PARAMETER name: index:1 type:.Param BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit @@ -131,39 +131,39 @@ FILE fqName: fileName:/functionalType.kt $this: GET_VAR '$this$null: .R declared in .test.' type=.R origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .C declared in .test.' type=.C origin=null + $this: GET_VAR '$context_receiver_0: .C declared in .test.' type=.C origin=null VAR name:lf2 type:@[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .Param, kotlin.Unit> [val] FUN_EXPR type=@[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .Param, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (_context_receiver_0:.C, :.Param) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($context_receiver_0:.C, :.Param) returnType:kotlin.Unit contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C VALUE_PARAMETER UNDERSCORE_PARAMETER name: index:1 type:.Param BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .C declared in .test.' type=.C origin=null + $this: GET_VAR '$context_receiver_0: .C declared in .test.' type=.C origin=null VAR name:lf3 type:@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .R, kotlin.Unit> [val] FUN_EXPR type=@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .R, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, _context_receiver_0:.C) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, $context_receiver_0:.C) returnType:kotlin.Unit contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name:$this$null type:.R - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .R' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR '$this$null: .R declared in .test.' type=.R origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .C declared in .test.' type=.C origin=null + $this: GET_VAR '$context_receiver_0: .C declared in .test.' type=.C origin=null VAR name:lf4 type:@[ContextFunctionTypeParams(count = '1')] kotlin.Function1<.C, kotlin.Unit> [val] FUN_EXPR type=@[ContextFunctionTypeParams(count = '1')] kotlin.Function1<.C, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (_context_receiver_0:.C) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($context_receiver_0:.C) returnType:kotlin.Unit contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .C declared in .test.' type=.C origin=null + $this: GET_VAR '$context_receiver_0: .C declared in .test.' type=.C origin=null 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 : .C : kotlin.Unit @@ -180,18 +180,18 @@ FILE fqName: fileName:/functionalType.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name:$this$with type:.R BLOCK_BODY - CALL 'public final fun f1 (_context_receiver_0: .C, g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.C, .R, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun f1 ($context_receiver_0: .C, g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.C, .R, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR '$this$with: .R declared in .test..' type=.R origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null g: GET_VAR 'val lf1: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.C, .R, .Param, kotlin.Unit> [val] declared in .test' type=@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.C, .R, .Param, kotlin.Unit> origin=null - CALL 'public final fun f1 (_context_receiver_0: .C, g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.C, .R, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun f1 ($context_receiver_0: .C, g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.C, .R, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR '$this$with: .R declared in .test..' type=.R origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null g: FUN_EXPR type=@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function3<.C, .R, .Param, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, _context_receiver_0:.C, :.Param) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, $context_receiver_0:.C, :.Param) returnType:kotlin.Unit contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name:$this$f1 type:.R - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C VALUE_PARAMETER UNDERSCORE_PARAMETER name: index:1 type:.Param BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit @@ -200,32 +200,32 @@ FILE fqName: fileName:/functionalType.kt TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null - CALL 'public final fun f2 (_context_receiver_0: .C, g: @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null + CALL 'public final fun f2 ($context_receiver_0: .C, g: @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null g: GET_VAR 'val lf2: @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .Param, kotlin.Unit> [val] declared in .test' type=@[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .Param, kotlin.Unit> origin=null - CALL 'public final fun f2 (_context_receiver_0: .C, g: @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null + CALL 'public final fun f2 ($context_receiver_0: .C, g: @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null g: FUN_EXPR type=@[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .Param, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (_context_receiver_0:.C, :.Param) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($context_receiver_0:.C, :.Param) returnType:kotlin.Unit contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C VALUE_PARAMETER UNDERSCORE_PARAMETER name: index:1 type:.Param BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null - CALL 'public final fun f3 (_context_receiver_0: .C, g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .R, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun f3 ($context_receiver_0: .C, g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .R, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR '$this$with: .R declared in .test..' type=.R origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null g: GET_VAR 'val lf3: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .R, kotlin.Unit> [val] declared in .test' type=@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .R, kotlin.Unit> origin=null - CALL 'public final fun f3 (_context_receiver_0: .C, g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .R, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun f3 ($context_receiver_0: .C, g: @[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .R, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR '$this$with: .R declared in .test..' type=.R origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null g: FUN_EXPR type=@[ExtensionFunctionType] @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .R, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, _context_receiver_0:.C) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, $context_receiver_0:.C) returnType:kotlin.Unit contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name:$this$f3 type:.R - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .R' type=kotlin.Int origin=GET_PROPERTY @@ -233,15 +233,15 @@ FILE fqName: fileName:/functionalType.kt TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null - CALL 'public final fun f4 (_context_receiver_0: .C, g: @[ContextFunctionTypeParams(count = '1')] kotlin.Function1<.C, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null + CALL 'public final fun f4 ($context_receiver_0: .C, g: @[ContextFunctionTypeParams(count = '1')] kotlin.Function1<.C, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null g: GET_VAR 'val lf4: @[ContextFunctionTypeParams(count = '1')] kotlin.Function1<.C, kotlin.Unit> [val] declared in .test' type=@[ContextFunctionTypeParams(count = '1')] kotlin.Function1<.C, kotlin.Unit> origin=null - CALL 'public final fun f4 (_context_receiver_0: .C, g: @[ContextFunctionTypeParams(count = '1')] kotlin.Function1<.C, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - _context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null + CALL 'public final fun f4 ($context_receiver_0: .C, g: @[ContextFunctionTypeParams(count = '1')] kotlin.Function1<.C, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $context_receiver_0: GET_VAR '$this$with: .C declared in .test.' type=.C origin=null g: FUN_EXPR type=@[ContextFunctionTypeParams(count = '1')] kotlin.Function1<.C, kotlin.Unit> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (_context_receiver_0:.C) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($context_receiver_0:.C) returnType:kotlin.Unit contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt.txt index 4e89c9f489f..5aaa71b2b47 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt.txt @@ -33,62 +33,62 @@ class R { } -fun R.f1(_context_receiver_0: C, g: @ExtensionFunctionType @ContextFunctionTypeParams(count = 1) Function3) { - g.invoke(p1 = _context_receiver_0, p2 = , p3 = Param()) +fun R.f1($context_receiver_0: C, g: @ExtensionFunctionType @ContextFunctionTypeParams(count = 1) Function3) { + g.invoke(p1 = $context_receiver_0, p2 = , p3 = Param()) } -fun f2(_context_receiver_0: C, g: @ContextFunctionTypeParams(count = 1) Function2) { - g.invoke(p1 = _context_receiver_0, p2 = Param()) +fun f2($context_receiver_0: C, g: @ContextFunctionTypeParams(count = 1) Function2) { + g.invoke(p1 = $context_receiver_0, p2 = Param()) } -fun R.f3(_context_receiver_0: C, g: @ExtensionFunctionType @ContextFunctionTypeParams(count = 1) Function2) { - g.invoke(p1 = _context_receiver_0, p2 = ) +fun R.f3($context_receiver_0: C, g: @ExtensionFunctionType @ContextFunctionTypeParams(count = 1) Function2) { + g.invoke(p1 = $context_receiver_0, p2 = ) } -fun f4(_context_receiver_0: C, g: @ContextFunctionTypeParams(count = 1) Function1) { - g.invoke(p1 = _context_receiver_0) +fun f4($context_receiver_0: C, g: @ContextFunctionTypeParams(count = 1) Function1) { + g.invoke(p1 = $context_receiver_0) } fun test() { - val lf1: @ExtensionFunctionType @ContextFunctionTypeParams(count = 1) Function3 = local fun R.(_context_receiver_0: C, : Param) { + val lf1: @ExtensionFunctionType @ContextFunctionTypeParams(count = 1) Function3 = local fun R.($context_receiver_0: C, : Param) { $this$null.() /*~> Unit */ - _context_receiver_0.() /*~> Unit */ + $context_receiver_0.() /*~> Unit */ } - val lf2: @ContextFunctionTypeParams(count = 1) Function2 = local fun (_context_receiver_0: C, : Param) { - _context_receiver_0.() /*~> Unit */ + val lf2: @ContextFunctionTypeParams(count = 1) Function2 = local fun ($context_receiver_0: C, : Param) { + $context_receiver_0.() /*~> Unit */ } - val lf3: @ExtensionFunctionType @ContextFunctionTypeParams(count = 1) Function2 = local fun R.(_context_receiver_0: C) { + val lf3: @ExtensionFunctionType @ContextFunctionTypeParams(count = 1) Function2 = local fun R.($context_receiver_0: C) { $this$null.() /*~> Unit */ - _context_receiver_0.() /*~> Unit */ + $context_receiver_0.() /*~> Unit */ } - val lf4: @ContextFunctionTypeParams(count = 1) Function1 = local fun (_context_receiver_0: C) { - _context_receiver_0.() /*~> Unit */ + val lf4: @ContextFunctionTypeParams(count = 1) Function1 = local fun ($context_receiver_0: C) { + $context_receiver_0.() /*~> Unit */ } with(receiver = C(), block = local fun C.() { with(receiver = R(), block = local fun R.() { - $this$with.f1(_context_receiver_0 = $this$with, g = lf1) - $this$with.f1(_context_receiver_0 = $this$with, g = local fun R.(_context_receiver_0: C, : Param) { + $this$with.f1($context_receiver_0 = $this$with, g = lf1) + $this$with.f1($context_receiver_0 = $this$with, g = local fun R.($context_receiver_0: C, : Param) { $this$f1.() /*~> Unit */ $this$with.() /*~> Unit */ } ) - f2(_context_receiver_0 = $this$with, g = lf2) - f2(_context_receiver_0 = $this$with, g = local fun (_context_receiver_0: C, : Param) { + f2($context_receiver_0 = $this$with, g = lf2) + f2($context_receiver_0 = $this$with, g = local fun ($context_receiver_0: C, : Param) { $this$with.() /*~> Unit */ } ) - $this$with.f3(_context_receiver_0 = $this$with, g = lf3) - $this$with.f3(_context_receiver_0 = $this$with, g = local fun R.(_context_receiver_0: C) { + $this$with.f3($context_receiver_0 = $this$with, g = lf3) + $this$with.f3($context_receiver_0 = $this$with, g = local fun R.($context_receiver_0: C) { $this$f3.() /*~> Unit */ $this$with.() /*~> Unit */ } ) - f4(_context_receiver_0 = $this$with, g = lf4) - f4(_context_receiver_0 = $this$with, g = local fun (_context_receiver_0: C) { + f4($context_receiver_0 = $this$with, g = lf4) + f4($context_receiver_0 = $this$with, g = local fun ($context_receiver_0: C) { $this$with.() /*~> Unit */ } ) diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.ir.txt index d219678c4ab..ba589d2a5ba 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.ir.txt @@ -3,13 +3,13 @@ FILE fqName: fileName:/genericOuterClass.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.A> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:T of .A visibility:private [final] - CONSTRUCTOR visibility:public <> (_context_receiver_0:T of .A) returnType:.A.A> [primary] - VALUE_PARAMETER name:_context_receiver_0 index:0 type:T of .A + CONSTRUCTOR visibility:public <> ($context_receiver_0:T of .A) returnType:.A.A> [primary] + VALUE_PARAMETER name:$context_receiver_0 index:0 type:T of .A BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:T of .A visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .A.A> declared in .A' type=.A.A> origin=null - value: GET_VAR '_context_receiver_0: T of .A declared in .A.' type=T of .A origin=null + value: GET_VAR '$context_receiver_0: T of .A declared in .A.' type=T of .A origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: @@ -28,13 +28,13 @@ FILE fqName: fileName:/genericOuterClass.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B

.B> TYPE_PARAMETER name:P index:0 variance: superTypes:[kotlin.Any?] reified:false FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.collections.Collection

.B> visibility:private [final] - CONSTRUCTOR visibility:public <> (_context_receiver_0:kotlin.collections.Collection

.B>) returnType:.B

.B> [primary] - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.collections.Collection

.B> + CONSTRUCTOR visibility:public <> ($context_receiver_0:kotlin.collections.Collection

.B>) returnType:.B

.B> [primary] + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.collections.Collection

.B> BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.collections.Collection

.B> visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .B

.B> declared in .B' type=.B

.B> origin=null - value: GET_VAR '_context_receiver_0: kotlin.collections.Collection

.B> declared in .B.' type=kotlin.collections.Collection

.B> origin=null + value: GET_VAR '$context_receiver_0: kotlin.collections.Collection

.B> declared in .B.' type=kotlin.collections.Collection

.B> origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: @@ -53,13 +53,13 @@ FILE fqName: fileName:/genericOuterClass.kt $receiver: VALUE_PARAMETER name: type:kotlin.Int BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CONSTRUCTOR_CALL 'public constructor (_context_receiver_0: T of .A) [primary] declared in .A' type=.A origin=null + CONSTRUCTOR_CALL 'public constructor ($context_receiver_0: T of .A) [primary] declared in .A' type=.A origin=null : kotlin.Int - _context_receiver_0: GET_VAR ': kotlin.Int declared in .foo' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR ': kotlin.Int declared in .foo' type=kotlin.Int origin=null FUN name:bar visibility:public modality:FINAL <> ($receiver:kotlin.collections.Collection) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:kotlin.collections.Collection BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CONSTRUCTOR_CALL 'public constructor (_context_receiver_0: kotlin.collections.Collection

.B>) [primary] declared in .B' type=.B origin=null + CONSTRUCTOR_CALL 'public constructor ($context_receiver_0: kotlin.collections.Collection

.B>) [primary] declared in .B' type=.B origin=null : kotlin.Int - _context_receiver_0: GET_VAR ': kotlin.collections.Collection declared in .bar' type=kotlin.collections.Collection origin=null + $context_receiver_0: GET_VAR ': kotlin.collections.Collection declared in .bar' type=kotlin.collections.Collection origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt.txt index b248966aae9..a4f98c15880 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt.txt @@ -1,8 +1,8 @@ class A { private /* final field */ val contextReceiverField0: T - constructor(_context_receiver_0: T) /* primary */ { + constructor($context_receiver_0: T) /* primary */ { super/*Any*/() - .#contextReceiverField0 = _context_receiver_0 + .#contextReceiverField0 = $context_receiver_0 /* () */ } @@ -11,9 +11,9 @@ class A { class B

{ private /* final field */ val contextReceiverField0: Collection

- constructor(_context_receiver_0: Collection

) /* primary */ { + constructor($context_receiver_0: Collection

) /* primary */ { super/*Any*/() - .#contextReceiverField0 = _context_receiver_0 + .#contextReceiverField0 = $context_receiver_0 /* () */ } @@ -21,9 +21,9 @@ class B

{ } fun Int.foo() { - A(_context_receiver_0 = ) /*~> Unit */ + A($context_receiver_0 = ) /*~> Unit */ } fun Collection.bar() { - B(_context_receiver_0 = ) /*~> Unit */ + B($context_receiver_0 = ) /*~> Unit */ } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.ir.txt index 3cbcaf6a190..906af14e2eb 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.ir.txt @@ -192,14 +192,14 @@ FILE fqName: fileName:/iteratorOperator.kt CLASS CLASS name:CounterIterator modality:FINAL visibility:public superTypes:[kotlin.collections.Iterator] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CounterIterator FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.CounterConfig visibility:private [final] - CONSTRUCTOR visibility:public <> (_context_receiver_0:.CounterConfig, counter:.Counter) returnType:.CounterIterator [primary] - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.CounterConfig + CONSTRUCTOR visibility:public <> ($context_receiver_0:.CounterConfig, counter:.Counter) returnType:.CounterIterator [primary] + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.CounterConfig VALUE_PARAMETER name:counter index:1 type:.Counter BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.CounterConfig visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .CounterIterator declared in .CounterIterator' type=.CounterIterator origin=null - value: GET_VAR '_context_receiver_0: .CounterConfig declared in .CounterIterator.' type=.CounterConfig origin=null + value: GET_VAR '$context_receiver_0: .CounterConfig declared in .CounterIterator.' type=.CounterConfig origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CounterIterator modality:FINAL visibility:public superTypes:[kotlin.collections.Iterator]' PROPERTY name:counter visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:counter type:.Counter visibility:private [final] @@ -256,23 +256,23 @@ FILE fqName: fileName:/iteratorOperator.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in kotlin.collections.Iterator $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:iterator visibility:public modality:FINAL <> ($receiver:.Counter, _context_receiver_0:.CounterConfig) returnType:.CounterIterator [operator] + FUN name:iterator visibility:public modality:FINAL <> ($receiver:.Counter, $context_receiver_0:.CounterConfig) returnType:.CounterIterator [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Counter - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.CounterConfig + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.CounterConfig BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun iterator (_context_receiver_0: .CounterConfig): .CounterIterator [operator] declared in ' + RETURN type=kotlin.Nothing from='public final fun iterator ($context_receiver_0: .CounterConfig): .CounterIterator [operator] declared in ' 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=.CounterIterator origin=null : .CounterConfig : .CounterIterator - receiver: GET_VAR '_context_receiver_0: .CounterConfig declared in .iterator' type=.CounterConfig origin=null + receiver: GET_VAR '$context_receiver_0: .CounterConfig declared in .iterator' type=.CounterConfig origin=null block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<.CounterConfig, .CounterIterator> origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.CounterConfig) returnType:.CounterIterator $receiver: VALUE_PARAMETER name:$this$with type:.CounterConfig BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): .CounterIterator declared in .iterator' - CONSTRUCTOR_CALL 'public constructor (_context_receiver_0: .CounterConfig, counter: .Counter) [primary] declared in .CounterIterator' type=.CounterIterator origin=null - _context_receiver_0: GET_VAR '$this$with: .CounterConfig declared in .iterator.' type=.CounterConfig origin=null + CONSTRUCTOR_CALL 'public constructor ($context_receiver_0: .CounterConfig, counter: .Counter) [primary] declared in .CounterIterator' type=.CounterIterator origin=null + $context_receiver_0: GET_VAR '$this$with: .CounterConfig declared in .iterator.' type=.CounterConfig origin=null counter: GET_VAR ': .Counter declared in .iterator' type=.Counter origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY @@ -288,9 +288,9 @@ FILE fqName: fileName:/iteratorOperator.kt BLOCK_BODY BLOCK type=kotlin.Unit origin=FOR_LOOP VAR FOR_LOOP_ITERATOR name:tmp_4 type:.CounterIterator [val] - CALL 'public final fun iterator (_context_receiver_0: .CounterConfig): .CounterIterator [operator] declared in ' type=.CounterIterator origin=null + CALL 'public final fun iterator ($context_receiver_0: .CounterConfig): .CounterIterator [operator] declared in ' type=.CounterIterator origin=null $receiver: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Counter' type=.Counter origin=null - _context_receiver_0: GET_VAR '$this$with: .CounterConfig declared in .box.' type=.CounterConfig origin=null + $context_receiver_0: GET_VAR '$this$with: .CounterConfig declared in .box.' type=.CounterConfig origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public open fun hasNext (): kotlin.Boolean [operator] declared in .CounterIterator' type=kotlin.Boolean origin=null $this: GET_VAR 'val tmp_4: .CounterIterator [val] declared in .box.' type=.CounterIterator origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.kt.txt index f66ae2152e5..8e4e2cd17b4 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.kt.txt @@ -87,9 +87,9 @@ data class CounterConfig { class CounterIterator : Iterator { private /* final field */ val contextReceiverField0: CounterConfig - constructor(_context_receiver_0: CounterConfig, counter: Counter) /* primary */ { + constructor($context_receiver_0: CounterConfig, counter: Counter) /* primary */ { super/*Any*/() - .#contextReceiverField0 = _context_receiver_0 + .#contextReceiverField0 = $context_receiver_0 /* () */ } @@ -113,9 +113,9 @@ class CounterIterator : Iterator { } -operator fun Counter.iterator(_context_receiver_0: CounterConfig): CounterIterator { - return with(receiver = _context_receiver_0, block = local fun CounterConfig.(): CounterIterator { - return CounterIterator(_context_receiver_0 = $this$with, counter = ) +operator fun Counter.iterator($context_receiver_0: CounterConfig): CounterIterator { + return with(receiver = $context_receiver_0, block = local fun CounterConfig.(): CounterIterator { + return CounterIterator($context_receiver_0 = $this$with, counter = ) } ) } @@ -124,7 +124,7 @@ fun box(): String { var result: Int = 0 with(receiver = CounterConfig(), block = local fun CounterConfig.() { { // BLOCK - val : CounterIterator = Counter().iterator(_context_receiver_0 = $this$with) + val : CounterIterator = Counter().iterator($context_receiver_0 = $this$with) while (.hasNext()) { // BLOCK val i: Int = .next() { // BLOCK diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.ir.txt index 52d31d5577b..8a952422961 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.ir.txt @@ -192,14 +192,14 @@ FILE fqName: fileName:/iteratorOperator.kt CLASS CLASS name:CounterIterator modality:FINAL visibility:public superTypes:[kotlin.collections.Iterator] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CounterIterator FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.CounterConfig visibility:private [final] - CONSTRUCTOR visibility:public <> (_context_receiver_0:.CounterConfig, counter:.Counter) returnType:.CounterIterator [primary] - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.CounterConfig + CONSTRUCTOR visibility:public <> ($context_receiver_0:.CounterConfig, counter:.Counter) returnType:.CounterIterator [primary] + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.CounterConfig VALUE_PARAMETER name:counter index:1 type:.Counter BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:.CounterConfig visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .CounterIterator declared in .CounterIterator' type=.CounterIterator origin=null - value: GET_VAR '_context_receiver_0: .CounterConfig declared in .CounterIterator.' type=.CounterConfig origin=null + value: GET_VAR '$context_receiver_0: .CounterConfig declared in .CounterIterator.' type=.CounterConfig origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CounterIterator modality:FINAL visibility:public superTypes:[kotlin.collections.Iterator]' PROPERTY name:counter visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:counter type:.Counter visibility:private [final] @@ -257,23 +257,23 @@ FILE fqName: fileName:/iteratorOperator.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in kotlin.collections.Iterator $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:iterator visibility:public modality:FINAL <> ($receiver:.Counter, _context_receiver_0:.CounterConfig) returnType:.CounterIterator [operator] + FUN name:iterator visibility:public modality:FINAL <> ($receiver:.Counter, $context_receiver_0:.CounterConfig) returnType:.CounterIterator [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Counter - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.CounterConfig + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.CounterConfig BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun iterator (_context_receiver_0: .CounterConfig): .CounterIterator [operator] declared in ' + RETURN type=kotlin.Nothing from='public final fun iterator ($context_receiver_0: .CounterConfig): .CounterIterator [operator] declared in ' 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=.CounterIterator origin=null : .CounterConfig : .CounterIterator - receiver: GET_VAR '_context_receiver_0: .CounterConfig declared in .iterator' type=.CounterConfig origin=null + receiver: GET_VAR '$context_receiver_0: .CounterConfig declared in .iterator' type=.CounterConfig origin=null block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.Function1<.CounterConfig, .CounterIterator> origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.CounterConfig) returnType:.CounterIterator $receiver: VALUE_PARAMETER name:$this$with type:.CounterConfig BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): .CounterIterator declared in .iterator' - CONSTRUCTOR_CALL 'public constructor (_context_receiver_0: .CounterConfig, counter: .Counter) [primary] declared in .CounterIterator' type=.CounterIterator origin=null - _context_receiver_0: GET_VAR '$this$with: .CounterConfig declared in .iterator.' type=.CounterConfig origin=null + CONSTRUCTOR_CALL 'public constructor ($context_receiver_0: .CounterConfig, counter: .Counter) [primary] declared in .CounterIterator' type=.CounterIterator origin=null + $context_receiver_0: GET_VAR '$this$with: .CounterConfig declared in .iterator.' type=.CounterConfig origin=null counter: GET_VAR ': .Counter declared in .iterator' type=.Counter origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY @@ -289,9 +289,9 @@ FILE fqName: fileName:/iteratorOperator.kt BLOCK_BODY BLOCK type=kotlin.Unit origin=FOR_LOOP VAR FOR_LOOP_ITERATOR name:tmp_4 type:.CounterIterator [val] - CALL 'public final fun iterator (_context_receiver_0: .CounterConfig): .CounterIterator [operator] declared in ' type=.CounterIterator origin=FOR_LOOP_ITERATOR + CALL 'public final fun iterator ($context_receiver_0: .CounterConfig): .CounterIterator [operator] declared in ' type=.CounterIterator origin=FOR_LOOP_ITERATOR $receiver: CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Counter' type=.Counter origin=null - _context_receiver_0: GET_VAR '$this$with: .CounterConfig declared in .box.' type=.CounterConfig origin=null + $context_receiver_0: GET_VAR '$this$with: .CounterConfig declared in .box.' type=.CounterConfig origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public open fun hasNext (): kotlin.Boolean [operator] declared in .CounterIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_4: .CounterIterator [val] declared in .box.' type=.CounterIterator origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt.txt index 0ea12516704..32209a42f11 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.kt.txt @@ -87,9 +87,9 @@ data class CounterConfig { class CounterIterator : Iterator { private /* final field */ val contextReceiverField0: CounterConfig - constructor(_context_receiver_0: CounterConfig, counter: Counter) /* primary */ { + constructor($context_receiver_0: CounterConfig, counter: Counter) /* primary */ { super/*Any*/() - .#contextReceiverField0 = _context_receiver_0 + .#contextReceiverField0 = $context_receiver_0 /* () */ } @@ -115,9 +115,9 @@ class CounterIterator : Iterator { } -operator fun Counter.iterator(_context_receiver_0: CounterConfig): CounterIterator { - return with(receiver = _context_receiver_0, block = local fun CounterConfig.(): CounterIterator { - return CounterIterator(_context_receiver_0 = $this$with, counter = ) +operator fun Counter.iterator($context_receiver_0: CounterConfig): CounterIterator { + return with(receiver = $context_receiver_0, block = local fun CounterConfig.(): CounterIterator { + return CounterIterator($context_receiver_0 = $this$with, counter = ) } ) } @@ -126,7 +126,7 @@ fun box(): String { var result: Int = 0 with(receiver = CounterConfig(), block = local fun CounterConfig.() { { // BLOCK - val tmp0_iterator: CounterIterator = Counter().iterator(_context_receiver_0 = $this$with) + val tmp0_iterator: CounterIterator = Counter().iterator($context_receiver_0 = $this$with) while (tmp0_iterator.hasNext()) { // BLOCK val i: Int = tmp0_iterator.next() { // BLOCK diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.ir.txt index 905edbb58e2..c9f86d61c00 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.ir.txt @@ -3,17 +3,17 @@ FILE fqName: fileName:/kt52791.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyClass FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Unit visibility:private [final] FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField1 type:kotlin.Int visibility:private [final] - CONSTRUCTOR visibility:public <> (_context_receiver_0:kotlin.Unit, _context_receiver_1:kotlin.Int) returnType:.MyClass [primary] - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Unit - VALUE_PARAMETER name:_context_receiver_1 index:1 type:kotlin.Int + CONSTRUCTOR visibility:public <> ($context_receiver_0:kotlin.Unit, $context_receiver_1:kotlin.Int) returnType:.MyClass [primary] + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Unit + VALUE_PARAMETER name:$context_receiver_1 index:1 type:kotlin.Int BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Unit visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .MyClass declared in .MyClass' type=.MyClass origin=null - value: GET_VAR '_context_receiver_0: kotlin.Unit declared in .MyClass.' type=kotlin.Unit origin=null + value: GET_VAR '$context_receiver_0: kotlin.Unit declared in .MyClass.' type=kotlin.Unit origin=null SET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField1 type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .MyClass declared in .MyClass' type=.MyClass origin=null - value: GET_VAR '_context_receiver_1: kotlin.Int declared in .MyClass.' type=kotlin.Int origin=null + value: GET_VAR '$context_receiver_1: kotlin.Int declared in .MyClass.' type=kotlin.Int origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any]' FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.kt.txt index f46f04f54d3..8122ede3593 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/kt52791.kt.txt @@ -1,10 +1,10 @@ class MyClass { private /* final field */ val contextReceiverField0: Unit private /* final field */ val contextReceiverField1: Int - constructor(_context_receiver_0: Unit, _context_receiver_1: Int) /* primary */ { + constructor($context_receiver_0: Unit, $context_receiver_1: Int) /* primary */ { super/*Any*/() - .#contextReceiverField0 = _context_receiver_0 - .#contextReceiverField1 = _context_receiver_1 + .#contextReceiverField0 = $context_receiver_0 + .#contextReceiverField1 = $context_receiver_1 /* () */ } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/lazy.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/lazy.ir.txt index 21f545065a3..70da78cfbc0 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/lazy.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/lazy.ir.txt @@ -15,22 +15,22 @@ FILE fqName: fileName:/lazy.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:test1 visibility:public modality:FINAL <> (_context_receiver_0:.Lazy, _context_receiver_1:.Lazy) returnType:kotlin.Unit + FUN name:test1 visibility:public modality:FINAL <> ($context_receiver_0:.Lazy, $context_receiver_1:.Lazy) returnType:kotlin.Unit contextReceiverParametersCount: 2 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Lazy - VALUE_PARAMETER name:_context_receiver_1 index:1 type:.Lazy + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Lazy + VALUE_PARAMETER name:$context_receiver_1 index:1 type:.Lazy BLOCK_BODY - FUN name:test2 visibility:public modality:FINAL ($receiver:.Lazy, _context_receiver_0:.Lazy.test2>) returnType:kotlin.Unit + FUN name:test2 visibility:public modality:FINAL ($receiver:.Lazy, $context_receiver_0:.Lazy.test2>) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Lazy - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Lazy.test2> + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Lazy.test2> BLOCK_BODY - FUN name:test3 visibility:public modality:FINAL ($receiver:.Lazy, _context_receiver_0:.Lazy<.Lazy.test3>>) returnType:kotlin.Unit + FUN name:test3 visibility:public modality:FINAL ($receiver:.Lazy, $context_receiver_0:.Lazy<.Lazy.test3>>) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Lazy - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Lazy<.Lazy.test3>> + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Lazy<.Lazy.test3>> BLOCK_BODY FUN name:f visibility:public modality:FINAL (lazy1:.Lazy, lazy2:.Lazy, lazyT:.Lazy.f>, lazyLazyT:.Lazy<.Lazy.f>>) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -55,13 +55,13 @@ FILE fqName: fileName:/lazy.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.Lazy) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name:$this$with type:.Lazy BLOCK_BODY - CALL 'public final fun test1 (_context_receiver_0: .Lazy, _context_receiver_1: .Lazy): kotlin.Unit declared in ' type=kotlin.Unit origin=null - _context_receiver_0: GET_VAR '$this$with: .Lazy declared in .f.' type=.Lazy origin=null - _context_receiver_1: GET_VAR '$this$with: .Lazy declared in .f..' type=.Lazy origin=null - CALL 'public final fun test2 (_context_receiver_0: .Lazy.test2>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun test1 ($context_receiver_0: .Lazy, $context_receiver_1: .Lazy): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $context_receiver_0: GET_VAR '$this$with: .Lazy declared in .f.' type=.Lazy origin=null + $context_receiver_1: GET_VAR '$this$with: .Lazy declared in .f..' type=.Lazy origin=null + CALL 'public final fun test2 ($context_receiver_0: .Lazy.test2>): kotlin.Unit declared in ' type=kotlin.Unit origin=null : kotlin.CharSequence $receiver: GET_VAR '$this$with: .Lazy declared in .f.' type=.Lazy origin=null - _context_receiver_0: GET_VAR '$this$with: .Lazy declared in .f..' type=.Lazy origin=null + $context_receiver_0: GET_VAR '$this$with: .Lazy declared in .f..' type=.Lazy origin=null 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 : .Lazy : kotlin.Unit @@ -78,13 +78,13 @@ FILE fqName: fileName:/lazy.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.Lazy) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name:$this$with type:.Lazy BLOCK_BODY - CALL 'public final fun test1 (_context_receiver_0: .Lazy, _context_receiver_1: .Lazy): kotlin.Unit declared in ' type=kotlin.Unit origin=null - _context_receiver_0: GET_VAR '$this$with: .Lazy declared in .f..' type=.Lazy origin=null - _context_receiver_1: GET_VAR '$this$with: .Lazy declared in .f.' type=.Lazy origin=null - CALL 'public final fun test2 (_context_receiver_0: .Lazy.test2>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun test1 ($context_receiver_0: .Lazy, $context_receiver_1: .Lazy): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $context_receiver_0: GET_VAR '$this$with: .Lazy declared in .f..' type=.Lazy origin=null + $context_receiver_1: GET_VAR '$this$with: .Lazy declared in .f.' type=.Lazy origin=null + CALL 'public final fun test2 ($context_receiver_0: .Lazy.test2>): kotlin.Unit declared in ' type=kotlin.Unit origin=null : kotlin.Int $receiver: GET_VAR '$this$with: .Lazy declared in .f..' type=.Lazy origin=null - _context_receiver_0: GET_VAR '$this$with: .Lazy declared in .f..' type=.Lazy origin=null + $context_receiver_0: GET_VAR '$this$with: .Lazy declared in .f..' type=.Lazy origin=null 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 : .Lazy.f> : kotlin.Unit @@ -101,10 +101,10 @@ FILE fqName: fileName:/lazy.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.Lazy) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name:$this$with type:.Lazy BLOCK_BODY - CALL 'public final fun test2 (_context_receiver_0: .Lazy.test2>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun test2 ($context_receiver_0: .Lazy.test2>): kotlin.Unit declared in ' type=kotlin.Unit origin=null : kotlin.Int $receiver: GET_VAR '$this$with: .Lazy declared in .f..' type=.Lazy origin=null - _context_receiver_0: GET_VAR '$this$with: .Lazy declared in .f..' type=.Lazy origin=null + $context_receiver_0: GET_VAR '$this$with: .Lazy declared in .f..' type=.Lazy origin=null 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 : .Lazy<.Lazy.f>> : kotlin.Unit @@ -121,14 +121,14 @@ FILE fqName: fileName:/lazy.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.Lazy) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name:$this$with type:.Lazy BLOCK_BODY - CALL 'public final fun test2 (_context_receiver_0: .Lazy.test2>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun test2 ($context_receiver_0: .Lazy.test2>): kotlin.Unit declared in ' type=kotlin.Unit origin=null : kotlin.Int $receiver: GET_VAR '$this$with: .Lazy declared in .f..' type=.Lazy origin=null - _context_receiver_0: GET_VAR '$this$with: .Lazy declared in .f..' type=.Lazy origin=null - CALL 'public final fun test3 (_context_receiver_0: .Lazy<.Lazy.test3>>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $context_receiver_0: GET_VAR '$this$with: .Lazy declared in .f..' type=.Lazy origin=null + CALL 'public final fun test3 ($context_receiver_0: .Lazy<.Lazy.test3>>): kotlin.Unit declared in ' type=kotlin.Unit origin=null : T of .f $receiver: GET_VAR '$this$with: .Lazy declared in .f..' type=.Lazy origin=null - _context_receiver_0: GET_VAR '$this$with: .Lazy<.Lazy.f>> declared in .f.' type=.Lazy<.Lazy.f>> origin=null + $context_receiver_0: GET_VAR '$this$with: .Lazy<.Lazy.f>> declared in .f.' type=.Lazy<.Lazy.f>> origin=null 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 : .Lazy : kotlin.Unit @@ -145,11 +145,11 @@ FILE fqName: fileName:/lazy.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.Lazy<.Lazy.f>>) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name:$this$with type:.Lazy<.Lazy.f>> BLOCK_BODY - CALL 'public final fun test2 (_context_receiver_0: .Lazy.test2>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun test2 ($context_receiver_0: .Lazy.test2>): kotlin.Unit declared in ' type=kotlin.Unit origin=null : .Lazy.f> $receiver: GET_VAR '$this$with: .Lazy declared in .f.' type=.Lazy origin=null - _context_receiver_0: GET_VAR '$this$with: .Lazy<.Lazy.f>> declared in .f..' type=.Lazy<.Lazy.f>> origin=null - CALL 'public final fun test3 (_context_receiver_0: .Lazy<.Lazy.test3>>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + $context_receiver_0: GET_VAR '$this$with: .Lazy<.Lazy.f>> declared in .f..' type=.Lazy<.Lazy.f>> origin=null + CALL 'public final fun test3 ($context_receiver_0: .Lazy<.Lazy.test3>>): kotlin.Unit declared in ' type=kotlin.Unit origin=null : T of .f $receiver: GET_VAR '$this$with: .Lazy declared in .f.' type=.Lazy origin=null - _context_receiver_0: GET_VAR '$this$with: .Lazy<.Lazy.f>> declared in .f..' type=.Lazy<.Lazy.f>> origin=null + $context_receiver_0: GET_VAR '$this$with: .Lazy<.Lazy.f>> declared in .f..' type=.Lazy<.Lazy.f>> origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/lazy.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/lazy.kt.txt index bb3349a75e2..02f5f028584 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/lazy.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/lazy.kt.txt @@ -2,51 +2,51 @@ interface Lazy { } -fun test1(_context_receiver_0: Lazy, _context_receiver_1: Lazy) { +fun test1($context_receiver_0: Lazy, $context_receiver_1: Lazy) { } -fun Lazy.test2(_context_receiver_0: Lazy) { +fun Lazy.test2($context_receiver_0: Lazy) { } -fun Lazy.test3(_context_receiver_0: Lazy>) { +fun Lazy.test3($context_receiver_0: Lazy>) { } fun f(lazy1: Lazy, lazy2: Lazy, lazyT: Lazy, lazyLazyT: Lazy>) { with, Unit>(receiver = lazy1, block = local fun Lazy.() { with, Unit>(receiver = lazy2, block = local fun Lazy.() { - test1(_context_receiver_0 = $this$with, _context_receiver_1 = $this$with) - $this$with.test2(_context_receiver_0 = $this$with) + test1($context_receiver_0 = $this$with, $context_receiver_1 = $this$with) + $this$with.test2($context_receiver_0 = $this$with) } ) } ) with, Unit>(receiver = lazy2, block = local fun Lazy.() { with, Unit>(receiver = lazy1, block = local fun Lazy.() { - test1(_context_receiver_0 = $this$with, _context_receiver_1 = $this$with) - $this$with.test2(_context_receiver_0 = $this$with) + test1($context_receiver_0 = $this$with, $context_receiver_1 = $this$with) + $this$with.test2($context_receiver_0 = $this$with) } ) } ) with, Unit>(receiver = lazyT, block = local fun Lazy.() { with, Unit>(receiver = lazy1, block = local fun Lazy.() { - $this$with.test2(_context_receiver_0 = $this$with) + $this$with.test2($context_receiver_0 = $this$with) } ) } ) with>, Unit>(receiver = lazyLazyT, block = local fun Lazy>.() { with, Unit>(receiver = lazy1, block = local fun Lazy.() { - $this$with.test2(_context_receiver_0 = $this$with) - $this$with.test3(_context_receiver_0 = $this$with) + $this$with.test2($context_receiver_0 = $this$with) + $this$with.test3($context_receiver_0 = $this$with) } ) } ) with, Unit>(receiver = lazy1, block = local fun Lazy.() { with>, Unit>(receiver = lazyLazyT, block = local fun Lazy>.() { - $this$with.test2>(_context_receiver_0 = $this$with) - $this$with.test3(_context_receiver_0 = $this$with) + $this$with.test2>($context_receiver_0 = $this$with) + $this$with.test3($context_receiver_0 = $this$with) } ) } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.ir.txt index d3a5dc1ce19..bf140b730f5 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.ir.txt @@ -18,11 +18,11 @@ FILE fqName: fileName:/overloadPriority.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:f visibility:public modality:FINAL <> (_context_receiver_0:.Context) returnType:kotlin.String + FUN name:f visibility:public modality:FINAL <> ($context_receiver_0:.Context) returnType:kotlin.String contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.Context + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.Context BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun f (_context_receiver_0: .Context): kotlin.String declared in ' + RETURN type=kotlin.Nothing from='public final fun f ($context_receiver_0: .Context): kotlin.String declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null FUN name:f visibility:public modality:FINAL <> () returnType:kotlin.Any BLOCK_BODY @@ -41,5 +41,5 @@ FILE fqName: fileName:/overloadPriority.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .test' CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY - $this: CALL 'public final fun f (_context_receiver_0: .Context): kotlin.String declared in ' type=kotlin.String origin=null - _context_receiver_0: GET_VAR '$this$with: .Context declared in .test.' type=.Context origin=null + $this: CALL 'public final fun f ($context_receiver_0: .Context): kotlin.String declared in ' type=kotlin.String origin=null + $context_receiver_0: GET_VAR '$this$with: .Context declared in .test.' type=.Context origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.kt.txt index 72c6f771651..dbe60d5c7fc 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/overloadPriority.kt.txt @@ -7,7 +7,7 @@ class Context { } -fun f(_context_receiver_0: Context): String { +fun f($context_receiver_0: Context): String { return TODO() } @@ -17,7 +17,7 @@ fun f(): Any { fun test() { with(receiver = Context(), block = local fun Context.(): Int { - return f(_context_receiver_0 = $this$with).() + return f($context_receiver_0 = $this$with).() } ) /*~> Unit */ } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/overloading.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/overloading.ir.txt index 00fb1e551b4..7e9fe93979d 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/overloading.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/overloading.ir.txt @@ -1,20 +1,20 @@ FILE fqName: fileName:/overloading.kt - FUN name:foo visibility:public modality:FINAL <> (_context_receiver_0:kotlin.Int, _context_receiver_1:kotlin.String) returnType:kotlin.Int + FUN name:foo visibility:public modality:FINAL <> ($context_receiver_0:kotlin.Int, $context_receiver_1:kotlin.String) returnType:kotlin.Int contextReceiverParametersCount: 2 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int - VALUE_PARAMETER name:_context_receiver_1 index:1 type:kotlin.String + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_1 index:1 type:kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (_context_receiver_0: kotlin.Int, _context_receiver_1: kotlin.String): kotlin.Int declared in ' + RETURN type=kotlin.Nothing from='public final fun foo ($context_receiver_0: kotlin.Int, $context_receiver_1: kotlin.String): kotlin.Int declared in ' CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: GET_VAR '_context_receiver_0: kotlin.Int declared in .foo' type=kotlin.Int origin=null + $this: GET_VAR '$context_receiver_0: kotlin.Int declared in .foo' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=42 - FUN name:foo visibility:public modality:FINAL <> (_context_receiver_0:kotlin.Int) returnType:kotlin.Int + FUN name:foo visibility:public modality:FINAL <> ($context_receiver_0:kotlin.Int) returnType:kotlin.Int contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (_context_receiver_0: kotlin.Int): kotlin.Int declared in ' + RETURN type=kotlin.Nothing from='public final fun foo ($context_receiver_0: kotlin.Int): kotlin.Int declared in ' CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: GET_VAR '_context_receiver_0: kotlin.Int declared in .foo' type=kotlin.Int origin=null + $this: GET_VAR '$context_receiver_0: kotlin.Int declared in .foo' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=42 FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY @@ -28,5 +28,5 @@ FILE fqName: fileName:/overloading.kt $receiver: VALUE_PARAMETER name:$this$with type:kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .test' - CALL 'public final fun foo (_context_receiver_0: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .test.' type=kotlin.Int origin=null + CALL 'public final fun foo ($context_receiver_0: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .test.' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/overloading.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/overloading.kt.txt index 13fedc8cb2a..d3eac2fd004 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/overloading.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/overloading.kt.txt @@ -1,14 +1,14 @@ -fun foo(_context_receiver_0: Int, _context_receiver_1: String): Int { - return _context_receiver_0.plus(other = 42) +fun foo($context_receiver_0: Int, $context_receiver_1: String): Int { + return $context_receiver_0.plus(other = 42) } -fun foo(_context_receiver_0: Int): Int { - return _context_receiver_0.plus(other = 42) +fun foo($context_receiver_0: Int): Int { + return $context_receiver_0.plus(other = 42) } fun test() { with(receiver = 42, block = local fun Int.(): Int { - return foo(_context_receiver_0 = $this$with) + return foo($context_receiver_0 = $this$with) } ) /*~> Unit */ } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.fir.ir.txt index cd3084c1fc9..586ff4d4795 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.fir.ir.txt @@ -41,10 +41,10 @@ FILE fqName: fileName:/passingLambdaToContextualParam.kt RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CALL 'public final fun contextual (f: kotlin.Function1<.C, kotlin.String>): kotlin.String declared in ' type=kotlin.String origin=null f: FUN_EXPR type=kotlin.Function1<.C, kotlin.String> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (_context_receiver_0:.C) returnType:kotlin.String + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($context_receiver_0:.C) returnType:kotlin.String contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (_context_receiver_0: .C): kotlin.String declared in .box' + RETURN type=kotlin.Nothing from='local final fun ($context_receiver_0: .C): kotlin.String declared in .box' CALL 'public final fun (): kotlin.String declared in .C' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .C declared in .box.' type=.C origin=null + $this: GET_VAR '$context_receiver_0: .C declared in .box.' type=.C origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.fir.kt.txt index 94e9134e7b8..45157a445da 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.fir.kt.txt @@ -16,8 +16,8 @@ fun contextual(f: Function1): String { } fun box(): String { - return contextual(f = local fun (_context_receiver_0: C): String { - return _context_receiver_0.() + return contextual(f = local fun ($context_receiver_0: C): String { + return $context_receiver_0.() } ) } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.ir.txt index ecb604831d1..9a8e8ba1d34 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.ir.txt @@ -41,10 +41,10 @@ FILE fqName: fileName:/passingLambdaToContextualParam.kt RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CALL 'public final fun contextual (f: @[ContextFunctionTypeParams(count = '1')] kotlin.Function1<.C, kotlin.String>): kotlin.String declared in ' type=kotlin.String origin=null f: FUN_EXPR type=@[ContextFunctionTypeParams(count = '1')] kotlin.Function1<.C, kotlin.String> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (_context_receiver_0:.C) returnType:kotlin.String + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($context_receiver_0:.C) returnType:kotlin.String contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.C + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.C BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (_context_receiver_0: .C): kotlin.String declared in .box' + RETURN type=kotlin.Nothing from='local final fun ($context_receiver_0: .C): kotlin.String declared in .box' CALL 'public final fun (): kotlin.String declared in .C' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .C declared in .box.' type=.C origin=null + $this: GET_VAR '$context_receiver_0: .C declared in .box.' type=.C origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.kt.txt index 0afbe1fcae0..65f526c6d30 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/passingLambdaToContextualParam.kt.txt @@ -16,8 +16,8 @@ fun contextual(f: @ContextFunctionTypeParams(count = 1) Function1): S } fun box(): String { - return contextual(f = local fun (_context_receiver_0: C): String { - return _context_receiver_0.() + return contextual(f = local fun ($context_receiver_0: C): String { + return $context_receiver_0.() } ) } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.ir.txt index 56bf88c0e3e..e1cb8f82ca4 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.ir.txt @@ -37,13 +37,13 @@ FILE fqName: fileName:/plusMatrix.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:plus visibility:public modality:FINAL <> ($receiver:.Matrix, _context_receiver_0:.NumberOperations, other:.Matrix) returnType:.Matrix + FUN name:plus visibility:public modality:FINAL <> ($receiver:.Matrix, $context_receiver_0:.NumberOperations, other:.Matrix) returnType:.Matrix contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Matrix - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.NumberOperations + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.NumberOperations VALUE_PARAMETER name:other index:1 type:.Matrix BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun plus (_context_receiver_0: .NumberOperations, other: .Matrix): .Matrix declared in ' + RETURN type=kotlin.Nothing from='public final fun plus ($context_receiver_0: .NumberOperations, other: .Matrix): .Matrix declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null FUN name:plusMatrix visibility:public modality:FINAL <> ($receiver:.NumberOperations, m1:.Matrix, m2:.Matrix) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.NumberOperations @@ -51,12 +51,12 @@ FILE fqName: fileName:/plusMatrix.kt VALUE_PARAMETER name:m2 index:1 type:.Matrix BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun plus (_context_receiver_0: .NumberOperations, other: .Matrix): .Matrix declared in ' type=.Matrix origin=null + CALL 'public final fun plus ($context_receiver_0: .NumberOperations, other: .Matrix): .Matrix declared in ' type=.Matrix origin=null $receiver: GET_VAR 'm1: .Matrix declared in .plusMatrix' type=.Matrix origin=null - _context_receiver_0: GET_VAR ': .NumberOperations declared in .plusMatrix' type=.NumberOperations origin=null + $context_receiver_0: GET_VAR ': .NumberOperations declared in .plusMatrix' type=.NumberOperations origin=null other: GET_VAR 'm2: .Matrix declared in .plusMatrix' type=.Matrix origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun plus (_context_receiver_0: .NumberOperations, other: .Matrix): .Matrix declared in ' type=.Matrix origin=null + CALL 'public final fun plus ($context_receiver_0: .NumberOperations, other: .Matrix): .Matrix declared in ' type=.Matrix origin=null $receiver: GET_VAR 'm2: .Matrix declared in .plusMatrix' type=.Matrix origin=null - _context_receiver_0: GET_VAR ': .NumberOperations declared in .plusMatrix' type=.NumberOperations origin=null + $context_receiver_0: GET_VAR ': .NumberOperations declared in .plusMatrix' type=.NumberOperations origin=null other: GET_VAR 'm1: .Matrix declared in .plusMatrix' type=.Matrix origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.kt.txt index 0659c7954d3..a38da23c182 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/plusMatrix.kt.txt @@ -12,11 +12,11 @@ class Matrix { } -fun Matrix.plus(_context_receiver_0: NumberOperations, other: Matrix): Matrix { +fun Matrix.plus($context_receiver_0: NumberOperations, other: Matrix): Matrix { return TODO() } fun NumberOperations.plusMatrix(m1: Matrix, m2: Matrix) { - m1.plus(_context_receiver_0 = , other = m2) /*~> Unit */ - m2.plus(_context_receiver_0 = , other = m1) /*~> Unit */ + m1.plus($context_receiver_0 = , other = m2) /*~> Unit */ + m2.plus($context_receiver_0 = , other = m1) /*~> Unit */ } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/property.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/property.ir.txt index e63f68564e6..b24bc09434e 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/property.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/property.ir.txt @@ -34,15 +34,15 @@ FILE fqName: fileName:/property.kt public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:c visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> (_context_receiver_0:.A, _context_receiver_1:.B) returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($context_receiver_0:.A, $context_receiver_1:.B) returnType:kotlin.Int correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val] contextReceiverParametersCount: 2 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.A - VALUE_PARAMETER name:_context_receiver_1 index:1 type:.B + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.A + VALUE_PARAMETER name:$context_receiver_1 index:1 type:.B BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (_context_receiver_0: .A, _context_receiver_1: .B): kotlin.Int declared in ' + RETURN type=kotlin.Nothing from='public final fun ($context_receiver_0: .A, $context_receiver_1: .B): kotlin.Int declared in ' CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS $this: CALL 'public abstract fun a (): kotlin.Int declared in .A' type=kotlin.Int origin=null - $this: GET_VAR '_context_receiver_0: .A declared in .' type=.A origin=null + $this: GET_VAR '$context_receiver_0: .A declared in .' type=.A origin=null other: CALL 'public abstract fun b (): kotlin.Int declared in .B' type=kotlin.Int origin=null - $this: GET_VAR '_context_receiver_1: .B declared in .' type=.B origin=null + $this: GET_VAR '$context_receiver_1: .B declared in .' type=.B origin=null diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/property.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/property.kt.txt index cef4e06e00d..e512241f5b6 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/property.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/property.kt.txt @@ -9,6 +9,6 @@ interface B { } val c: Int - get(_context_receiver_0: A, _context_receiver_1: B): Int { - return _context_receiver_0.a().plus(other = _context_receiver_1.b()) + get($context_receiver_0: A, $context_receiver_1: B): Int { + return $context_receiver_0.a().plus(other = $context_receiver_1.b()) } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.ir.txt index 082b9a55bca..9a5a0e63891 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.ir.txt @@ -93,43 +93,43 @@ FILE fqName: fileName:/thisWithCustomLabel.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:f visibility:public modality:FINAL <> (_context_receiver_0:.A, _context_receiver_1:.A, _context_receiver_2:.B) returnType:kotlin.Unit + FUN name:f visibility:public modality:FINAL <> ($context_receiver_0:.A, $context_receiver_1:.A, $context_receiver_2:.B) returnType:kotlin.Unit contextReceiverParametersCount: 3 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.A - VALUE_PARAMETER name:_context_receiver_1 index:1 type:.A - VALUE_PARAMETER name:_context_receiver_2 index:2 type:.B + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.A + VALUE_PARAMETER name:$context_receiver_1 index:1 type:.A + VALUE_PARAMETER name:$context_receiver_2 index:2 type:.B BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public open fun toFloat (): kotlin.Float declared in kotlin.Int' type=kotlin.Float origin=null $this: CALL 'public final fun (): T of .A declared in .A' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .A declared in .f' type=.A origin=null + $this: GET_VAR '$context_receiver_0: .A declared in .f' type=.A origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY $this: CALL 'public final fun (): T of .A declared in .A' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_1: .A declared in .f' type=.A origin=null + $this: GET_VAR '$context_receiver_1: .A declared in .f' type=.A origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Any declared in .B' type=kotlin.Any origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_2: .B declared in .f' type=.B origin=null + $this: GET_VAR '$context_receiver_2: .B declared in .f' type=.B origin=null PROPERTY name:p visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($receiver:.C, _context_receiver_0:.A, _context_receiver_1:.A, _context_receiver_2:.B) returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($receiver:.C, $context_receiver_0:.A, $context_receiver_1:.A, $context_receiver_2:.B) returnType:kotlin.Int correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val] contextReceiverParametersCount: 3 $receiver: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:_context_receiver_0 index:0 type:.A - VALUE_PARAMETER name:_context_receiver_1 index:1 type:.A - VALUE_PARAMETER name:_context_receiver_2 index:2 type:.B + VALUE_PARAMETER name:$context_receiver_0 index:0 type:.A + VALUE_PARAMETER name:$context_receiver_1 index:1 type:.A + VALUE_PARAMETER name:$context_receiver_2 index:2 type:.B BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public open fun toFloat (): kotlin.Float declared in kotlin.Int' type=kotlin.Float origin=null $this: CALL 'public final fun (): T of .A declared in .A' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_0: .A declared in .' type=.A origin=null + $this: GET_VAR '$context_receiver_0: .A declared in .' type=.A origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY $this: CALL 'public final fun (): T of .A declared in .A' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_1: .A declared in .' type=.A origin=null + $this: GET_VAR '$context_receiver_1: .A declared in .' type=.A origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Any declared in .B' type=kotlin.Any origin=GET_PROPERTY - $this: GET_VAR '_context_receiver_2: .B declared in .' type=.B origin=null + $this: GET_VAR '$context_receiver_2: .B declared in .' type=.B origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Any declared in .C' type=kotlin.Any origin=GET_PROPERTY $this: GET_VAR ': .C declared in .' type=.C origin=null @@ -139,5 +139,5 @@ FILE fqName: fileName:/thisWithCustomLabel.kt TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): kotlin.Any declared in .C' type=kotlin.Any origin=GET_PROPERTY $this: GET_VAR ': .C declared in .' type=.C origin=null - RETURN type=kotlin.Nothing from='public final fun (_context_receiver_0: .A, _context_receiver_1: .A, _context_receiver_2: .B): kotlin.Int declared in ' + RETURN type=kotlin.Nothing from='public final fun ($context_receiver_0: .A, $context_receiver_1: .A, $context_receiver_2: .B): kotlin.Int declared in ' CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt.txt index 37acd8f8ebf..6986bcb1ed4 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt.txt @@ -37,17 +37,17 @@ class C { } -fun f(_context_receiver_0: A, _context_receiver_1: A, _context_receiver_2: B) { - _context_receiver_0.().toFloat() /*~> Unit */ - _context_receiver_1.().() /*~> Unit */ - _context_receiver_2.() /*~> Unit */ +fun f($context_receiver_0: A, $context_receiver_1: A, $context_receiver_2: B) { + $context_receiver_0.().toFloat() /*~> Unit */ + $context_receiver_1.().() /*~> Unit */ + $context_receiver_2.() /*~> Unit */ } val C.p: Int - get(_context_receiver_0: A, _context_receiver_1: A, _context_receiver_2: B): Int { - _context_receiver_0.().toFloat() /*~> Unit */ - _context_receiver_1.().() /*~> Unit */ - _context_receiver_2.() /*~> Unit */ + get($context_receiver_0: A, $context_receiver_1: A, $context_receiver_2: B): Int { + $context_receiver_0.().toFloat() /*~> Unit */ + $context_receiver_1.().() /*~> Unit */ + $context_receiver_2.() /*~> Unit */ .() /*~> Unit */ .() /*~> Unit */ .() /*~> Unit */ diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.ir.txt index a87bb46109f..02f36d5091c 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.ir.txt @@ -1,8 +1,8 @@ FILE fqName: fileName:/typeParameterAsContextReceiver.kt - FUN name:useContext visibility:public modality:FINAL (_context_receiver_0:T of .useContext, block:kotlin.Function1.useContext, kotlin.Unit>) returnType:kotlin.Unit + FUN name:useContext visibility:public modality:FINAL ($context_receiver_0:T of .useContext, block:kotlin.Function1.useContext, kotlin.Unit>) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false contextReceiverParametersCount: 1 - VALUE_PARAMETER name:_context_receiver_0 index:0 type:T of .useContext + VALUE_PARAMETER name:$context_receiver_0 index:0 type:T of .useContext VALUE_PARAMETER name:block index:1 type:kotlin.Function1.useContext, kotlin.Unit> BLOCK_BODY FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit @@ -15,9 +15,9 @@ FILE fqName: fileName:/typeParameterAsContextReceiver.kt 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 (_context_receiver_0: T of .useContext, block: kotlin.Function1.useContext, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun useContext ($context_receiver_0: T of .useContext, block: kotlin.Function1.useContext, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null : kotlin.Int - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .test.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .test.' type=kotlin.Int origin=null 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 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt.txt index dd0bd6806f8..724f9f1edee 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/typeParameterAsContextReceiver.kt.txt @@ -1,9 +1,9 @@ -fun useContext(_context_receiver_0: T, block: Function1) { +fun useContext($context_receiver_0: T, block: Function1) { } fun test() { with(receiver = 42, block = local fun Int.() { - useContext(_context_receiver_0 = $this$with, block = local fun (i: Int) { + useContext($context_receiver_0 = $this$with, block = local fun (i: Int) { i.toDouble() /*~> Unit */ } ) diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.ir.txt index 078619fbe5d..9403c47aa1d 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.ir.txt @@ -103,30 +103,30 @@ FILE fqName: fileName:/unaryOperators.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null - FUN name:unaryMinus visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int) returnType:.Result [operator] + FUN name:unaryMinus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .unaryMinus' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun unaryMinus (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .unaryMinus' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun unaryMinus ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Result declared in .unaryMinus' type=.Result origin=null - FUN name:unaryPlus visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int) returnType:.Result [operator] + FUN name:unaryPlus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .unaryPlus' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun unaryPlus (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .unaryPlus' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun unaryPlus ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: WHEN type=kotlin.Int origin=IF BRANCH @@ -141,31 +141,31 @@ FILE fqName: fileName:/unaryOperators.kt if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Result declared in .unaryPlus' type=.Result origin=null - FUN name:inc visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int) returnType:.Result [operator] + FUN name:inc visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .inc' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun inc (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .inc' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun inc ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: 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 (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Result declared in .inc' type=.Result origin=null other: CONST Int type=kotlin.Int value=1 - FUN name:dec visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int) returnType:.Result [operator] + FUN name:dec visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int BLOCK_BODY CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .dec' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun dec (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .dec' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun dec ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MINUS $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY @@ -190,35 +190,35 @@ FILE fqName: fileName:/unaryOperators.kt VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.Result [val] GET_VAR 'var result: .Result [var] declared in .box' type=.Result origin=null SET_VAR 'var result: .Result [var] declared in .box' type=kotlin.Unit origin=EQ - CALL 'public final fun inc (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=null + CALL 'public final fun inc ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=null $receiver: GET_VAR 'val tmp_1: .Result [val] declared in .box.' type=.Result origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null GET_VAR 'val tmp_1: .Result [val] declared in .box.' type=.Result origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=.Result origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.Result [val] GET_VAR 'var result: .Result [var] declared in .box' type=.Result origin=null SET_VAR 'var result: .Result [var] declared in .box' type=kotlin.Unit origin=EQ - CALL 'public final fun inc (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=null + CALL 'public final fun inc ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=null $receiver: GET_VAR 'val tmp_2: .Result [val] declared in .box.' type=.Result origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null GET_VAR 'val tmp_2: .Result [val] declared in .box.' type=.Result origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun unaryMinus (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=null + CALL 'public final fun unaryMinus ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=null $receiver: GET_VAR 'var result: .Result [var] declared in .box' type=.Result origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun unaryPlus (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=null + CALL 'public final fun unaryPlus ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=null $receiver: GET_VAR 'var result: .Result [var] declared in .box' type=.Result origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null RETURN type=kotlin.Nothing from='local final fun (): .Result declared in .box' BLOCK type=.Result origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.Result [val] GET_VAR 'var result: .Result [var] declared in .box' type=.Result origin=null SET_VAR 'var result: .Result [var] declared in .box' type=kotlin.Unit origin=EQ - CALL 'public final fun dec (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=null + CALL 'public final fun dec ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=null $receiver: GET_VAR 'val tmp_3: .Result [val] declared in .box.' type=.Result origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null GET_VAR 'val tmp_3: .Result [val] declared in .box.' type=.Result origin=null RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' WHEN type=kotlin.String origin=IF diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.kt.txt index a758eeff982..ba3e64b97a6 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.kt.txt @@ -46,26 +46,26 @@ var operationScore: Int get set -operator fun Result.unaryMinus(_context_receiver_0: Int): Result { - ( = ().plus(other = _context_receiver_0)) +operator fun Result.unaryMinus($context_receiver_0: Int): Result { + ( = ().plus(other = $context_receiver_0)) return Result(i = .().unaryMinus()) } -operator fun Result.unaryPlus(_context_receiver_0: Int): Result { - ( = ().plus(other = _context_receiver_0)) +operator fun Result.unaryPlus($context_receiver_0: Int): Result { + ( = ().plus(other = $context_receiver_0)) return Result(i = when { less(arg0 = .(), arg1 = 0) -> .().unaryMinus() else -> .() }) } -operator fun Result.inc(_context_receiver_0: Int): Result { - ( = ().plus(other = _context_receiver_0)) +operator fun Result.inc($context_receiver_0: Int): Result { + ( = ().plus(other = $context_receiver_0)) return Result(i = .().plus(other = 1)) } -operator fun Result.dec(_context_receiver_0: Int): Result { - ( = ().plus(other = _context_receiver_0)) +operator fun Result.dec($context_receiver_0: Int): Result { + ( = ().plus(other = $context_receiver_0)) return Result(i = .().minus(other = 1)) } @@ -74,19 +74,19 @@ fun box(): String { with(receiver = 1, block = local fun Int.(): Result { { // BLOCK val : Result = result - result = .inc(_context_receiver_0 = $this$with) + result = .inc($context_receiver_0 = $this$with) } /*~> Unit */ { // BLOCK val : Result = result - result = .inc(_context_receiver_0 = $this$with) + result = .inc($context_receiver_0 = $this$with) } /*~> Unit */ - result.unaryMinus(_context_receiver_0 = $this$with) /*~> Unit */ - result.unaryPlus(_context_receiver_0 = $this$with) /*~> Unit */ + result.unaryMinus($context_receiver_0 = $this$with) /*~> Unit */ + result.unaryPlus($context_receiver_0 = $this$with) /*~> Unit */ return { // BLOCK val : Result = result - result = .dec(_context_receiver_0 = $this$with) + result = .dec($context_receiver_0 = $this$with) } } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.ir.txt index 90bce5f0f78..9110f351ec1 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.ir.txt @@ -103,32 +103,32 @@ FILE fqName: fileName:/unaryOperators.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:operationScore type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null - FUN name:unaryMinus visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int) returnType:.Result [operator] + FUN name:unaryMinus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .unaryMinus' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun unaryMinus (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .unaryMinus' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun unaryMinus ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CALL 'public final fun unaryMinus (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=UMINUS $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Result declared in .unaryMinus' type=.Result origin=null - FUN name:unaryPlus visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int) returnType:.Result [operator] + FUN name:unaryPlus visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .unaryPlus' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun unaryPlus (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .unaryPlus' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun unaryPlus ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: WHEN type=kotlin.Int origin=IF BRANCH @@ -143,33 +143,33 @@ FILE fqName: fileName:/unaryOperators.kt if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Result declared in .unaryPlus' type=.Result origin=null - FUN name:inc visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int) returnType:.Result [operator] + FUN name:inc visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .inc' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun inc (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .inc' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun inc ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: 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 (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Result declared in .inc' type=.Result origin=null other: CONST Int type=kotlin.Int value=1 - FUN name:dec visibility:public modality:FINAL <> ($receiver:.Result, _context_receiver_0:kotlin.Int) returnType:.Result [operator] + FUN name:dec visibility:public modality:FINAL <> ($receiver:.Result, $context_receiver_0:kotlin.Int) returnType:.Result [operator] contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name: type:.Result - VALUE_PARAMETER name:_context_receiver_0 index:0 type:kotlin.Int + VALUE_PARAMETER name:$context_receiver_0 index:0 type:kotlin.Int BLOCK_BODY BLOCK type=kotlin.Unit origin=PLUSEQ CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUSEQ $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=PLUSEQ - other: GET_VAR '_context_receiver_0: kotlin.Int declared in .dec' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun dec (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' + other: GET_VAR '$context_receiver_0: kotlin.Int declared in .dec' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun dec ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=MINUS $this: CALL 'public final fun (): kotlin.Int declared in .Result' type=kotlin.Int origin=GET_PROPERTY @@ -194,35 +194,35 @@ FILE fqName: fileName:/unaryOperators.kt VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.Result [val] GET_VAR 'var result: .Result [var] declared in .box' type=.Result origin=POSTFIX_INCR SET_VAR 'var result: .Result [var] declared in .box' type=kotlin.Unit origin=POSTFIX_INCR - CALL 'public final fun inc (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=POSTFIX_INCR + CALL 'public final fun inc ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=POSTFIX_INCR $receiver: GET_VAR 'val tmp_1: .Result [val] declared in .box.' type=.Result origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null GET_VAR 'val tmp_1: .Result [val] declared in .box.' type=.Result origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=.Result origin=POSTFIX_INCR VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.Result [val] GET_VAR 'var result: .Result [var] declared in .box' type=.Result origin=POSTFIX_INCR SET_VAR 'var result: .Result [var] declared in .box' type=kotlin.Unit origin=POSTFIX_INCR - CALL 'public final fun inc (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=POSTFIX_INCR + CALL 'public final fun inc ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=POSTFIX_INCR $receiver: GET_VAR 'val tmp_2: .Result [val] declared in .box.' type=.Result origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null GET_VAR 'val tmp_2: .Result [val] declared in .box.' type=.Result origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun unaryMinus (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=UMINUS + CALL 'public final fun unaryMinus ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=UMINUS $receiver: GET_VAR 'var result: .Result [var] declared in .box' type=.Result origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun unaryPlus (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=UPLUS + CALL 'public final fun unaryPlus ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=UPLUS $receiver: GET_VAR 'var result: .Result [var] declared in .box' type=.Result origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null RETURN type=kotlin.Nothing from='local final fun (): .Result declared in .box' BLOCK type=.Result origin=POSTFIX_DECR VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.Result [val] GET_VAR 'var result: .Result [var] declared in .box' type=.Result origin=POSTFIX_DECR SET_VAR 'var result: .Result [var] declared in .box' type=kotlin.Unit origin=POSTFIX_DECR - CALL 'public final fun dec (_context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=POSTFIX_DECR + CALL 'public final fun dec ($context_receiver_0: kotlin.Int): .Result [operator] declared in ' type=.Result origin=POSTFIX_DECR $receiver: GET_VAR 'val tmp_3: .Result [val] declared in .box.' type=.Result origin=null - _context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null + $context_receiver_0: GET_VAR '$this$with: kotlin.Int declared in .box.' type=kotlin.Int origin=null GET_VAR 'val tmp_3: .Result [val] declared in .box.' type=.Result origin=null RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' WHEN type=kotlin.String origin=IF diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.kt.txt index 52f6bb7b210..223c03a3847 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.kt.txt @@ -46,16 +46,16 @@ var operationScore: Int get set -operator fun Result.unaryMinus(_context_receiver_0: Int): Result { +operator fun Result.unaryMinus($context_receiver_0: Int): Result { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } return Result(i = .().unaryMinus()) } -operator fun Result.unaryPlus(_context_receiver_0: Int): Result { +operator fun Result.unaryPlus($context_receiver_0: Int): Result { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } return Result(i = when { less(arg0 = .(), arg1 = 0) -> .().unaryMinus() @@ -63,16 +63,16 @@ operator fun Result.unaryPlus(_context_receiver_0: Int): Result { }) } -operator fun Result.inc(_context_receiver_0: Int): Result { +operator fun Result.inc($context_receiver_0: Int): Result { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } return Result(i = .().plus(other = 1)) } -operator fun Result.dec(_context_receiver_0: Int): Result { +operator fun Result.dec($context_receiver_0: Int): Result { { // BLOCK - ( = ().plus(other = _context_receiver_0)) + ( = ().plus(other = $context_receiver_0)) } return Result(i = .().minus(other = 1)) } @@ -82,19 +82,19 @@ fun box(): String { with(receiver = 1, block = local fun Int.(): Result { { // BLOCK val tmp0: Result = result - result = tmp0.inc(_context_receiver_0 = $this$with) + result = tmp0.inc($context_receiver_0 = $this$with) tmp0 } /*~> Unit */ { // BLOCK val tmp1: Result = result - result = tmp1.inc(_context_receiver_0 = $this$with) + result = tmp1.inc($context_receiver_0 = $this$with) tmp1 } /*~> Unit */ - result.unaryMinus(_context_receiver_0 = $this$with) /*~> Unit */ - result.unaryPlus(_context_receiver_0 = $this$with) /*~> Unit */ + result.unaryMinus($context_receiver_0 = $this$with) /*~> Unit */ + result.unaryPlus($context_receiver_0 = $this$with) /*~> Unit */ return { // BLOCK val tmp2: Result = result - result = tmp2.dec(_context_receiver_0 = $this$with) + result = tmp2.dec($context_receiver_0 = $this$with) tmp2 } } diff --git a/core/compiler.common/src/org/jetbrains/kotlin/name/NameUtils.kt b/core/compiler.common/src/org/jetbrains/kotlin/name/NameUtils.kt index 418fda09e78..0b89fe8dffd 100644 --- a/core/compiler.common/src/org/jetbrains/kotlin/name/NameUtils.kt +++ b/core/compiler.common/src/org/jetbrains/kotlin/name/NameUtils.kt @@ -64,5 +64,5 @@ object NameUtils { @JvmStatic fun contextReceiverName(index: Int): Name = - Name.identifier("_context_receiver_$index") + Name.identifier("\$context_receiver_$index") }