From 0bfea4fc523d0a10698f72038726e07802b367e2 Mon Sep 17 00:00:00 2001 From: Anastasiya Shadrina Date: Wed, 17 Nov 2021 05:22:21 +0700 Subject: [PATCH] [IR, Tests] Fix functionalType sample --- .../contextReceivers/functionalType.ir.txt | 16 ++++++++-------- .../contextReceivers/functionalType.kt.txt | 9 +++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.ir.txt index 9d1f384e252..fb890dfe9d7 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.ir.txt @@ -120,11 +120,11 @@ FILE fqName: fileName:/functionalType.kt 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, :.C, $noName_0:.Param) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, :.C, :.Param) returnType:kotlin.Unit contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name:$this$null type:.R VALUE_PARAMETER name: index:0 type:.C - VALUE_PARAMETER name:$noName_0 index:1 type:.Param + 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 .R' type=kotlin.Int origin=GET_PROPERTY @@ -134,10 +134,10 @@ FILE fqName: fileName:/functionalType.kt $this: GET_VAR ': .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 <> (:.C, $noName_0:.Param) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (:.C, :.Param) returnType:kotlin.Unit contextReceiverParametersCount: 1 VALUE_PARAMETER name: index:0 type:.C - VALUE_PARAMETER name:$noName_0 index:1 type:.Param + 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 @@ -188,11 +188,11 @@ FILE fqName: fileName:/functionalType.kt $receiver: GET_VAR '$this$with: .R declared in .test..' type=.R origin=null : 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, :.C, $noName_0:.Param) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.R, :.C, :.Param) returnType:kotlin.Unit contextReceiverParametersCount: 1 $receiver: VALUE_PARAMETER name:$this$f1 type:.R VALUE_PARAMETER name: index:0 type:.C - VALUE_PARAMETER name:$noName_0 index:1 type:.Param + 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 .R' type=kotlin.Int origin=GET_PROPERTY @@ -206,10 +206,10 @@ FILE fqName: fileName:/functionalType.kt CALL 'public final fun f2 (: .C, g: @[ContextFunctionTypeParams(count = '1')] kotlin.Function2<.C, .Param, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null : 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 <> (:.C, $noName_0:.Param) returnType:kotlin.Unit + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (:.C, :.Param) returnType:kotlin.Unit contextReceiverParametersCount: 1 VALUE_PARAMETER name: index:0 type:.C - VALUE_PARAMETER name:$noName_0 index:1 type:.Param + 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 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt.txt index 00097c65620..c1758dad909 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/functionalType.kt.txt @@ -50,12 +50,12 @@ fun f4(: C, g: @ContextFunctionTypeParams(count = 1) Function1) { } fun test() { - val lf1: @ExtensionFunctionType @ContextFunctionTypeParams(count = 1) Function3 = local fun R.(: C, $noName_0: Param) { + val lf1: @ExtensionFunctionType @ContextFunctionTypeParams(count = 1) Function3 = local fun R.(: C, : Param) { $this$null.() /*~> Unit */ .() /*~> Unit */ } - val lf2: @ContextFunctionTypeParams(count = 1) Function2 = local fun (: C, $noName_0: Param) { + val lf2: @ContextFunctionTypeParams(count = 1) Function2 = local fun (: C, : Param) { .() /*~> Unit */ } @@ -71,13 +71,13 @@ fun test() { with(receiver = C(), block = local fun C.() { with(receiver = R(), block = local fun R.() { $this$with.f1( = $this$with, g = lf1) - $this$with.f1( = $this$with, g = local fun R.(: C, $noName_0: Param) { + $this$with.f1( = $this$with, g = local fun R.(: C, : Param) { $this$f1.() /*~> Unit */ $this$with.() /*~> Unit */ } ) f2( = $this$with, g = lf2) - f2( = $this$with, g = local fun (: C, $noName_0: Param) { + f2( = $this$with, g = local fun (: C, : Param) { $this$with.() /*~> Unit */ } ) @@ -97,3 +97,4 @@ fun test() { } ) } +