From fe0c25693d29124bbe237b76692a1d79e15244aa Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Wed, 16 Dec 2020 14:22:02 -0800 Subject: [PATCH] FIR2IR: do not convert @ExtensionFunctionType twice --- .../kotlin/fir/backend/Fir2IrBuiltIns.kt | 7 -- .../kotlin/fir/backend/Fir2IrTypeConverter.kt | 4 +- .../ir/irText/classes/initValInLambda.fir.txt | 2 +- ...mbdaInDataClassDefaultParameter.fir.kt.txt | 8 +- .../lambdaInDataClassDefaultParameter.fir.txt | 40 +++--- .../parameters/lambdas.fir.kt.txt | 2 +- .../declarations/parameters/lambdas.fir.txt | 8 +- .../adaptedExtensionFunctions.fir.kt.txt | 2 +- .../adaptedExtensionFunctions.fir.txt | 10 +- .../expressions/extFunInvokeAsFun.fir.kt.txt | 7 -- .../expressions/extFunInvokeAsFun.fir.txt | 17 --- .../irText/expressions/extFunInvokeAsFun.kt | 1 + .../expressions/extFunSafeInvoke.fir.kt.txt | 9 -- .../expressions/extFunSafeInvoke.fir.txt | 22 ---- .../ir/irText/expressions/extFunSafeInvoke.kt | 1 + .../ir/irText/expressions/kt37570.fir.txt | 2 +- .../sam/samConversionToGeneric.fir.kt.txt | 4 +- .../sam/samConversionToGeneric.fir.txt | 14 +-- ...ConversionOnArbitraryExpression.fir.kt.txt | 28 ++--- ...endConversionOnArbitraryExpression.fir.txt | 116 +++++++++--------- .../variableAsFunctionCall.fir.kt.txt | 2 +- .../variableAsFunctionCall.fir.txt | 8 +- .../irText/firProblems/AllCandidates.fir.txt | 2 +- .../typeVariableAfterBuildMap.fir.txt | 2 +- .../ir/irText/lambdas/extensionLambda.fir.txt | 2 +- .../lambdas/multipleImplicitReceivers.fir.txt | 6 +- .../ir/irText/stubs/builtinMap.fir.txt | 2 +- .../castsInsideCoroutineInference.fir.kt.txt | 14 +-- .../castsInsideCoroutineInference.fir.txt | 56 ++++----- 29 files changed, 168 insertions(+), 230 deletions(-) delete mode 100644 compiler/testData/ir/irText/expressions/extFunInvokeAsFun.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/expressions/extFunInvokeAsFun.fir.txt delete mode 100644 compiler/testData/ir/irText/expressions/extFunSafeInvoke.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/expressions/extFunSafeInvoke.fir.txt diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrBuiltIns.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrBuiltIns.kt index a9cd66793e4..81c951dd015 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrBuiltIns.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrBuiltIns.kt @@ -23,13 +23,6 @@ class Fir2IrBuiltIns( provider?.initComponents(components) } - private val extensionFunctionTypeAnnotationSymbol by lazy { - annotationSymbolById(CompilerConeAttributes.ExtensionFunctionType.ANNOTATION_CLASS_ID) - } - - internal fun extensionFunctionTypeAnnotationConstructorCall(): IrConstructorCall = - extensionFunctionTypeAnnotationSymbol!!.toConstructorCall() - private val enhancedNullabilityAnnotationSymbol by lazy { annotationSymbolById(CompilerConeAttributes.EnhancedNullability.ANNOTATION_CLASS_ID) } diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrTypeConverter.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrTypeConverter.kt index aaadc1ca71e..dd8028efa84 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrTypeConverter.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrTypeConverter.kt @@ -88,9 +88,7 @@ class Fir2IrTypeConverter( val firSymbol = this.lookupTag.toSymbol(session) ?: return createErrorType() firSymbol.toSymbol(session, classifierStorage, typeContext) } - val typeAnnotations: MutableList = - if (!isExtensionFunctionType) mutableListOf() - else mutableListOf(builtIns.extensionFunctionTypeAnnotationConstructorCall()) + val typeAnnotations: MutableList = mutableListOf() typeAnnotations += with(annotationGenerator) { annotations.toIrAnnotations() } if (hasEnhancedNullability) { builtIns.enhancedNullabilityAnnotationConstructorCall()?.let { diff --git a/compiler/testData/ir/irText/classes/initValInLambda.fir.txt b/compiler/testData/ir/irText/classes/initValInLambda.fir.txt index 17a083eaa50..c6efa0dc7d8 100644 --- a/compiler/testData/ir/irText/classes/initValInLambda.fir.txt +++ b/compiler/testData/ir/irText/classes/initValInLambda.fir.txt @@ -16,7 +16,7 @@ FILE fqName: fileName:/initValInLambda.kt receiver: GET_VAR ': .TestInitValInLambdaCalledOnce declared in .TestInitValInLambdaCalledOnce.' type=.TestInitValInLambdaCalledOnce origin=null ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY - CALL 'public final fun run (block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1): R of kotlin.run [inline] declared in kotlin' type=kotlin.Unit origin=null + CALL 'public final fun run (block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.run [inline] declared in kotlin' type=kotlin.Unit origin=null : kotlin.Int : kotlin.Unit $receiver: CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.kt.txt b/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.kt.txt index 726406607bb..22448fd726c 100644 --- a/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.kt.txt @@ -1,5 +1,5 @@ data class A { - constructor(runA: @ExtensionFunctionType @ExtensionFunctionType Function2 = local fun A.(it: String) { + constructor(runA: @ExtensionFunctionType Function2 = local fun A.(it: String) { return Unit } ) /* primary */ { @@ -8,15 +8,15 @@ data class A { } - val runA: @ExtensionFunctionType @ExtensionFunctionType Function2 + val runA: @ExtensionFunctionType Function2 field = runA get - fun component1(): @ExtensionFunctionType @ExtensionFunctionType Function2 { + fun component1(): @ExtensionFunctionType Function2 { return .#runA } - fun copy(runA: @ExtensionFunctionType @ExtensionFunctionType Function2 = .#runA): A { + fun copy(runA: @ExtensionFunctionType Function2 = .#runA): A { return A(runA = runA) } diff --git a/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt b/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt index 4180b5b498f..921be13b44b 100644 --- a/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt +++ b/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt @@ -1,8 +1,8 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (runA:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>) returnType:.A [primary] - VALUE_PARAMETER name:runA index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> + CONSTRUCTOR visibility:public <> (runA:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>) returnType:.A [primary] + VALUE_PARAMETER name:runA index:0 type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> EXPRESSION_BODY FUN_EXPR type=kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.A, it:kotlin.String) returnType:kotlin.Unit @@ -15,32 +15,32 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' PROPERTY name:runA visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final] + FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final] EXPRESSION_BODY - GET_VAR 'runA: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A.' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> + GET_VAR 'runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A.' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> correspondingProperty: PROPERTY name:runA visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.A BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null + RETURN type=kotlin.Nothing from='public final fun (): @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null - FUN name:component1 visibility:public modality:FINAL <> ($this:.A) returnType:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> + FUN name:component1 visibility:public modality:FINAL <> ($this:.A) returnType:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> $this: VALUE_PARAMETER name: type:.A BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component1 (): @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null + RETURN type=kotlin.Nothing from='public final fun component1 (): @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null receiver: GET_VAR ': .A declared in .A.component1' type=.A origin=null - FUN name:copy visibility:public modality:FINAL <> ($this:.A, runA:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>) returnType:.A + FUN name:copy visibility:public modality:FINAL <> ($this:.A, runA:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>) returnType:.A $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:runA index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> + VALUE_PARAMETER name:runA index:0 type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> EXPRESSION_BODY - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null receiver: GET_VAR ': .A declared in .A.copy' type=.A origin=null BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun copy (runA: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>): .A declared in .A' - CONSTRUCTOR_CALL 'public constructor (runA: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>) [primary] declared in .A' type=.A origin=null - runA: GET_VAR 'runA: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A.copy' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null + RETURN type=kotlin.Nothing from='public final fun copy (runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>): .A declared in .A' + CONSTRUCTOR_CALL 'public constructor (runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>) [primary] declared in .A' type=.A origin=null + runA: GET_VAR 'runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A.copy' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any @@ -67,9 +67,9 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt BRANCH if: 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_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null receiver: GET_VAR ': .A declared in .A.equals' type=.A origin=null - arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null + arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null receiver: GET_VAR 'val tmp_0: .A [val] declared in .A.equals' type=.A origin=null then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' CONST Boolean type=kotlin.Boolean value=false @@ -82,7 +82,7 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String overridden: @@ -93,7 +93,7 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt STRING_CONCATENATION type=kotlin.String CONST String type=kotlin.String value="A(" CONST String type=kotlin.String value="runA=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null receiver: GET_VAR ': .A declared in .A.toString' type=.A origin=null CONST String type=kotlin.String value=")" CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[kotlin.Any] diff --git a/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.kt.txt b/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.kt.txt index e097d10a472..3947169f441 100644 --- a/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.kt.txt @@ -5,7 +5,7 @@ val test1: Function1 get -val test2: @ExtensionFunctionType @ExtensionFunctionType Function2 +val test2: @ExtensionFunctionType Function2 field = local fun Any.(it: Any): Int { return it.hashCode() } diff --git a/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt b/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt index 4e81fb31a3d..f8322c87f07 100644 --- a/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt @@ -14,7 +14,7 @@ FILE fqName: fileName:/lambdas.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function1 declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1 visibility:private [final,static]' type=kotlin.Function1 origin=null PROPERTY name:test2 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test2 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2 visibility:private [final,static] + FIELD PROPERTY_BACKING_FIELD name:test2 type:@[ExtensionFunctionType] kotlin.Function2 visibility:private [final,static] EXPRESSION_BODY FUN_EXPR type=kotlin.Function2 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlin.Any, it:kotlin.Any) returnType:kotlin.Int @@ -24,11 +24,11 @@ FILE fqName: fileName:/lambdas.kt RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Any): kotlin.Int declared in .test2' CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null $this: GET_VAR 'it: kotlin.Any declared in .test2.' type=kotlin.Any origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:@[ExtensionFunctionType] kotlin.Function2 correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2 declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2 visibility:private [final,static]' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2 origin=null + RETURN type=kotlin.Nothing from='public final fun (): @[ExtensionFunctionType] kotlin.Function2 declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:@[ExtensionFunctionType] kotlin.Function2 visibility:private [final,static]' type=@[ExtensionFunctionType] kotlin.Function2 origin=null PROPERTY name:test3 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Function2 visibility:private [final,static] EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.kt.txt index 801dd51fa50..0dd8e57a20b 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.kt.txt @@ -1,4 +1,4 @@ -fun use(f: @ExtensionFunctionType @ExtensionFunctionType Function2) { +fun use(f: @ExtensionFunctionType Function2) { } class C { diff --git a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.txt index 16809547e9a..7cacf363154 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/adaptedExtensionFunctions.fir.txt @@ -1,6 +1,6 @@ FILE fqName: fileName:/adaptedExtensionFunctions.kt - FUN name:use visibility:public modality:FINAL <> (f:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>) returnType:kotlin.Unit - VALUE_PARAMETER name:f index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit> + FUN name:use visibility:public modality:FINAL <> (f:@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>) returnType:kotlin.Unit + VALUE_PARAMETER name:f index:0 type:@[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit> BLOCK_BODY CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C @@ -43,13 +43,13 @@ FILE fqName: fileName:/adaptedExtensionFunctions.kt BLOCK_BODY FUN name:testExtensionVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - CALL 'public final fun use (f: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun use (f: @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null f: FUNCTION_REFERENCE 'public final fun extensionVararg (i: kotlin.Int, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.reflect.KFunction2<.C, kotlin.Int, kotlin.Unit> origin=null reflectionTarget= FUN name:testExtensionDefault visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - CALL 'public final fun use (f: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun use (f: @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null f: FUNCTION_REFERENCE 'public final fun extensionDefault (i: kotlin.Int, s: kotlin.String): kotlin.Unit declared in ' type=kotlin.reflect.KFunction2<.C, kotlin.Int, kotlin.Unit> origin=null reflectionTarget= FUN name:testExtensionBoth visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - CALL 'public final fun use (f: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun use (f: @[ExtensionFunctionType] kotlin.Function2<.C, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null f: FUNCTION_REFERENCE 'public final fun extensionBoth (i: kotlin.Int, s: kotlin.String, vararg t: kotlin.String): kotlin.Unit declared in ' type=kotlin.reflect.KFunction2<.C, kotlin.Int, kotlin.Unit> origin=null reflectionTarget= diff --git a/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.fir.kt.txt b/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.fir.kt.txt deleted file mode 100644 index de1341623b5..00000000000 --- a/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.fir.kt.txt +++ /dev/null @@ -1,7 +0,0 @@ -fun with1(receiver: Any?, block: @ExtensionFunctionType @ExtensionFunctionType Function1) { - return block.invoke(p1 = receiver) -} - -fun with2(receiver: Any?, block: @ExtensionFunctionType @ExtensionFunctionType Function1) { - return block.invoke(p1 = receiver) -} diff --git a/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.fir.txt b/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.fir.txt deleted file mode 100644 index 13ced496642..00000000000 --- a/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.fir.txt +++ /dev/null @@ -1,17 +0,0 @@ -FILE fqName: fileName:/extFunInvokeAsFun.kt - FUN name:with1 visibility:public modality:FINAL <> (receiver:kotlin.Any?, block:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:receiver index:0 type:kotlin.Any? - VALUE_PARAMETER name:block index:1 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun with1 (receiver: kotlin.Any?, block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1): kotlin.Unit declared in ' - 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 'block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .with1' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=VARIABLE_AS_FUNCTION - p1: GET_VAR 'receiver: kotlin.Any? declared in .with1' type=kotlin.Any? origin=null - FUN name:with2 visibility:public modality:FINAL <> (receiver:kotlin.Any?, block:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:receiver index:0 type:kotlin.Any? - VALUE_PARAMETER name:block index:1 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun with2 (receiver: kotlin.Any?, block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1): kotlin.Unit declared in ' - 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 'block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .with2' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=VARIABLE_AS_FUNCTION - p1: GET_VAR 'receiver: kotlin.Any? declared in .with2' type=kotlin.Any? origin=null diff --git a/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.kt b/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.kt index 983bcfae575..3cd68aee830 100644 --- a/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.kt +++ b/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DUMP_DEPENDENCIES fun with1(receiver: Any?, block: Any?.() -> Unit) = block(receiver) diff --git a/compiler/testData/ir/irText/expressions/extFunSafeInvoke.fir.kt.txt b/compiler/testData/ir/irText/expressions/extFunSafeInvoke.fir.kt.txt deleted file mode 100644 index dff7557aa76..00000000000 --- a/compiler/testData/ir/irText/expressions/extFunSafeInvoke.fir.kt.txt +++ /dev/null @@ -1,9 +0,0 @@ -fun test(receiver: Any?, fn: @ExtensionFunctionType @ExtensionFunctionType Function3): Unit? { - return { // BLOCK - val tmp0_safe_receiver: Any? = receiver - when { - EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> fn.invoke(p1 = tmp0_safe_receiver, p2 = 42, p3 = "Hello") - } - } -} diff --git a/compiler/testData/ir/irText/expressions/extFunSafeInvoke.fir.txt b/compiler/testData/ir/irText/expressions/extFunSafeInvoke.fir.txt deleted file mode 100644 index 60d3941c3c4..00000000000 --- a/compiler/testData/ir/irText/expressions/extFunSafeInvoke.fir.txt +++ /dev/null @@ -1,22 +0,0 @@ -FILE fqName: fileName:/extFunSafeInvoke.kt - FUN name:test visibility:public modality:FINAL <> (receiver:kotlin.Any?, fn:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function3) returnType:kotlin.Unit? - VALUE_PARAMETER name:receiver index:0 type:kotlin.Any? - VALUE_PARAMETER name:fn index:1 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function3 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test (receiver: kotlin.Any?, fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function3): kotlin.Unit? declared in ' - BLOCK type=kotlin.Unit? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any? [val] - GET_VAR 'receiver: kotlin.Any? declared in .test' type=kotlin.Any? origin=null - WHEN type=kotlin.Unit? origin=null - 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: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .test' type=kotlin.Any? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Null type=kotlin.Nothing? value=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: 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 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function3 declared in .test' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function3 origin=VARIABLE_AS_FUNCTION - p1: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .test' type=kotlin.Any? origin=null - p2: CONST Int type=kotlin.Int value=42 - p3: CONST String type=kotlin.String value="Hello" diff --git a/compiler/testData/ir/irText/expressions/extFunSafeInvoke.kt b/compiler/testData/ir/irText/expressions/extFunSafeInvoke.kt index 6a13282dde7..d8fa490cd1c 100644 --- a/compiler/testData/ir/irText/expressions/extFunSafeInvoke.kt +++ b/compiler/testData/ir/irText/expressions/extFunSafeInvoke.kt @@ -1,2 +1,3 @@ +// FIR_IDENTICAL fun test(receiver: Any?, fn: Any.(Int, String) -> Unit) = receiver?.fn(42, "Hello") \ No newline at end of file diff --git a/compiler/testData/ir/irText/expressions/kt37570.fir.txt b/compiler/testData/ir/irText/expressions/kt37570.fir.txt index f85315f8871..16424ad49d3 100644 --- a/compiler/testData/ir/irText/expressions/kt37570.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt37570.fir.txt @@ -21,7 +21,7 @@ FILE fqName: fileName:/kt37570.kt ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun apply (block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1): T of kotlin.apply [inline] declared in kotlin' type=kotlin.String origin=null + CALL 'public final fun apply (block: @[ExtensionFunctionType] kotlin.Function1): T of kotlin.apply [inline] declared in kotlin' type=kotlin.String origin=null : kotlin.String $receiver: CALL 'public final fun a (): kotlin.String declared in ' type=kotlin.String origin=null block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.kt.txt index d0245f2b431..a81462a07eb 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.kt.txt @@ -38,11 +38,11 @@ fun test7(a: Any) { bar(j = a /*as Function1 */ /*-> J? */) } -fun test8(efn: @ExtensionFunctionType @ExtensionFunctionType Function1): J { +fun test8(efn: @ExtensionFunctionType Function1): J { return efn /*-> J */ } -fun test9(efn: @ExtensionFunctionType @ExtensionFunctionType Function1) { +fun test9(efn: @ExtensionFunctionType Function1) { bar(j = efn /*-> J? */) } diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt index e956025229a..f42df5fa5fd 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt @@ -72,19 +72,19 @@ FILE fqName: fileName:/samConversionToGeneric.kt j: TYPE_OP type=.J.H.bar?>? origin=SAM_CONVERSION typeOperand=.J.H.bar?>? TYPE_OP type=kotlin.Function1.test7, T of .test7> origin=IMPLICIT_CAST typeOperand=kotlin.Function1.test7, T of .test7> GET_VAR 'a: kotlin.Any declared in .test7' type=kotlin.Any origin=null - FUN name:test8 visibility:public modality:FINAL <> (efn:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1) returnType:.J - VALUE_PARAMETER name:efn index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 + FUN name:test8 visibility:public modality:FINAL <> (efn:@[ExtensionFunctionType] kotlin.Function1) returnType:.J + VALUE_PARAMETER name:efn index:0 type:@[ExtensionFunctionType] kotlin.Function1 BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test8 (efn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1): .J declared in ' + RETURN type=kotlin.Nothing from='public final fun test8 (efn: @[ExtensionFunctionType] kotlin.Function1): .J declared in ' TYPE_OP type=.J origin=SAM_CONVERSION typeOperand=.J - GET_VAR 'efn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .test8' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null - FUN name:test9 visibility:public modality:FINAL <> (efn:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:efn index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 + GET_VAR 'efn: @[ExtensionFunctionType] kotlin.Function1 declared in .test8' type=@[ExtensionFunctionType] kotlin.Function1 origin=null + FUN name:test9 visibility:public modality:FINAL <> (efn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:efn index:0 type:@[ExtensionFunctionType] kotlin.Function1 BLOCK_BODY CALL 'public open fun bar (j: .J.H.bar?>?): kotlin.Unit declared in .H' type=kotlin.Unit origin=null : kotlin.String? j: TYPE_OP type=.J.H.bar?>? origin=SAM_CONVERSION typeOperand=.J.H.bar?>? - GET_VAR 'efn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .test9' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null + GET_VAR 'efn: @[ExtensionFunctionType] kotlin.Function1 declared in .test9' type=@[ExtensionFunctionType] kotlin.Function1 origin=null FUN name:test10 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.kt.txt b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.kt.txt index 58f8cee23af..d3aea965056 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.kt.txt @@ -1,7 +1,7 @@ fun useSuspend(sfn: SuspendFunction0) { } -fun useSuspendExt(sfn: @ExtensionFunctionType @ExtensionFunctionType SuspendFunction1) { +fun useSuspendExt(sfn: @ExtensionFunctionType SuspendFunction1) { } fun useSuspendArg(sfn: SuspendFunction1) { @@ -10,7 +10,7 @@ fun useSuspendArg(sfn: SuspendFunction1) { fun useSuspendArgT(sfn: SuspendFunction1) { } -fun useSuspendExtT(sfn: @ExtensionFunctionType @ExtensionFunctionType SuspendFunction1) { +fun useSuspendExtT(sfn: @ExtensionFunctionType SuspendFunction1) { } fun produceFun(): Function0 { @@ -40,9 +40,9 @@ fun testSimpleNonVal() { }) } -fun testExtAsExt(fn: @ExtensionFunctionType @ExtensionFunctionType Function1) { +fun testExtAsExt(fn: @ExtensionFunctionType Function1) { useSuspendExt(sfn = { // BLOCK - local suspend fun @ExtensionFunctionType @ExtensionFunctionType Function1.suspendConversion(p0: Int) { + local suspend fun @ExtensionFunctionType Function1.suspendConversion(p0: Int) { callee.invoke(p1 = p0) } @@ -50,9 +50,9 @@ fun testExtAsExt(fn: @ExtensionFunctionType @ExtensionFunctionType Function1) { +fun testExtAsSimple(fn: @ExtensionFunctionType Function1) { useSuspendArg(sfn = { // BLOCK - local suspend fun @ExtensionFunctionType @ExtensionFunctionType Function1.suspendConversion(p0: Int) { + local suspend fun @ExtensionFunctionType Function1.suspendConversion(p0: Int) { callee.invoke(p1 = p0) } @@ -90,9 +90,9 @@ fun testSimpleAsExtT(fn: Function1) { }) } -fun testExtAsSimpleT(fn: @ExtensionFunctionType @ExtensionFunctionType Function1) { +fun testExtAsSimpleT(fn: @ExtensionFunctionType Function1) { useSuspendArgT(sfn = { // BLOCK - local suspend fun @ExtensionFunctionType @ExtensionFunctionType Function1.suspendConversion(p0: T) { + local suspend fun @ExtensionFunctionType Function1.suspendConversion(p0: T) { callee.invoke(p1 = p0) } @@ -100,9 +100,9 @@ fun testExtAsSimpleT(fn: @ExtensionFunctionType @ExtensionFunctionType Function1 }) } -fun testExtAsExtT(fn: @ExtensionFunctionType @ExtensionFunctionType Function1) { +fun testExtAsExtT(fn: @ExtensionFunctionType Function1) { useSuspendExtT(sfn = { // BLOCK - local suspend fun @ExtensionFunctionType @ExtensionFunctionType Function1.suspendConversion(p0: T) { + local suspend fun @ExtensionFunctionType Function1.suspendConversion(p0: T) { callee.invoke(p1 = p0) } @@ -130,9 +130,9 @@ fun testSimpleSAsExtT(fn: Function1) { }) } -fun testExtSAsSimpleT(fn: @ExtensionFunctionType @ExtensionFunctionType Function1) { +fun testExtSAsSimpleT(fn: @ExtensionFunctionType Function1) { useSuspendArgT(sfn = { // BLOCK - local suspend fun @ExtensionFunctionType @ExtensionFunctionType Function1.suspendConversion(p0: T) { + local suspend fun @ExtensionFunctionType Function1.suspendConversion(p0: T) { callee.invoke(p1 = p0) } @@ -140,9 +140,9 @@ fun testExtSAsSimpleT(fn: @ExtensionFunctionType @ExtensionFunctionTy }) } -fun testExtSAsExtT(fn: @ExtensionFunctionType @ExtensionFunctionType Function1) { +fun testExtSAsExtT(fn: @ExtensionFunctionType Function1) { useSuspendExtT(sfn = { // BLOCK - local suspend fun @ExtensionFunctionType @ExtensionFunctionType Function1.suspendConversion(p0: T) { + local suspend fun @ExtensionFunctionType Function1.suspendConversion(p0: T) { callee.invoke(p1 = p0) } diff --git a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt index e80e8af23f0..09cebecbb93 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt @@ -2,8 +2,8 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt FUN name:useSuspend visibility:public modality:FINAL <> (sfn:kotlin.coroutines.SuspendFunction0) returnType:kotlin.Unit VALUE_PARAMETER name:sfn index:0 type:kotlin.coroutines.SuspendFunction0 BLOCK_BODY - FUN name:useSuspendExt visibility:public modality:FINAL <> (sfn:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1) returnType:kotlin.Unit - VALUE_PARAMETER name:sfn index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 + FUN name:useSuspendExt visibility:public modality:FINAL <> (sfn:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1) returnType:kotlin.Unit + VALUE_PARAMETER name:sfn index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 BLOCK_BODY FUN name:useSuspendArg visibility:public modality:FINAL <> (sfn:kotlin.coroutines.SuspendFunction1) returnType:kotlin.Unit VALUE_PARAMETER name:sfn index:0 type:kotlin.coroutines.SuspendFunction1 @@ -12,9 +12,9 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:sfn index:0 type:kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> BLOCK_BODY - FUN name:useSuspendExtT visibility:public modality:FINAL (sfn:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>) returnType:kotlin.Unit + FUN name:useSuspendExtT visibility:public modality:FINAL (sfn:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:sfn index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> + VALUE_PARAMETER name:sfn index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> BLOCK_BODY FUN name:produceFun visibility:public modality:FINAL <> () returnType:kotlin.Function0 BLOCK_BODY @@ -47,39 +47,39 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt $this: GET_VAR 'callee: kotlin.Function0 declared in .testSimpleNonVal.suspendConversion' type=kotlin.Function0 origin=null FUNCTION_REFERENCE 'local final fun suspendConversion (): kotlin.Unit [suspend] declared in .testSimpleNonVal' type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION reflectionTarget=null $receiver: CALL 'public final fun produceFun (): kotlin.Function0 declared in ' type=kotlin.Function0 origin=null - FUN name:testExtAsExt visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 + FUN name:testExtAsExt visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1 BLOCK_BODY - CALL 'public final fun useSuspendExt (sfn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 + CALL 'public final fun useSuspendExt (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: BLOCK type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1 VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int 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=null - $this: GET_VAR 'callee: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExt.suspendConversion' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null + $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExt.suspendConversion' type=@[ExtensionFunctionType] kotlin.Function1 origin=null p1: GET_VAR 'p0: kotlin.Int declared in .testExtAsExt.suspendConversion' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (p0: kotlin.Int): kotlin.Unit [suspend] declared in .testExtAsExt' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExt' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null - FUN name:testExtAsSimple visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 + FUNCTION_REFERENCE 'local final fun suspendConversion (p0: kotlin.Int): kotlin.Unit [suspend] declared in .testExtAsExt' type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExt' type=@[ExtensionFunctionType] kotlin.Function1 origin=null + FUN name:testExtAsSimple visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1 BLOCK_BODY CALL 'public final fun useSuspendArg (sfn: kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null sfn: BLOCK type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1 VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int 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=null - $this: GET_VAR 'callee: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimple.suspendConversion' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null + $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimple.suspendConversion' type=@[ExtensionFunctionType] kotlin.Function1 origin=null p1: GET_VAR 'p0: kotlin.Int declared in .testExtAsSimple.suspendConversion' type=kotlin.Int origin=null FUNCTION_REFERENCE 'local final fun suspendConversion (p0: kotlin.Int): kotlin.Unit [suspend] declared in .testExtAsSimple' type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimple' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null + $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimple' type=@[ExtensionFunctionType] kotlin.Function1 origin=null FUN name:testSimpleAsExt visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 BLOCK_BODY - CALL 'public final fun useSuspendExt (sfn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION + CALL 'public final fun useSuspendExt (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null + sfn: BLOCK type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function1, p0:kotlin.Int) returnType:kotlin.Unit [suspend] $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1 VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int @@ -87,7 +87,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 [operator] declared in kotlin.Function1' type=kotlin.Unit origin=null $this: GET_VAR 'callee: kotlin.Function1 declared in .testSimpleAsExt.suspendConversion' type=kotlin.Function1 origin=null p1: GET_VAR 'p0: kotlin.Int declared in .testSimpleAsExt.suspendConversion' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (p0: kotlin.Int): kotlin.Unit [suspend] declared in .testSimpleAsExt' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null + FUNCTION_REFERENCE 'local final fun suspendConversion (p0: kotlin.Int): kotlin.Unit [suspend] declared in .testSimpleAsExt' type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION reflectionTarget=null $receiver: GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExt' type=kotlin.Function1 origin=null FUN name:testSimpleAsSimpleT visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 @@ -107,9 +107,9 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt FUN name:testSimpleAsExtT visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 BLOCK_BODY - CALL 'public final fun useSuspendExtT (sfn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun useSuspendExtT (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null : kotlin.Int - sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION + sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function1, p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1 VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendExtT @@ -117,38 +117,38 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 [operator] declared in kotlin.Function1' type=kotlin.Unit origin=null $this: GET_VAR 'callee: kotlin.Function1 declared in .testSimpleAsExtT.suspendConversion' type=kotlin.Function1 origin=null p1: GET_VAR 'p0: T of .useSuspendExtT declared in .testSimpleAsExtT.suspendConversion' type=T of .useSuspendExtT origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendExtT): kotlin.Unit [suspend] declared in .testSimpleAsExtT' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null + FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendExtT): kotlin.Unit [suspend] declared in .testSimpleAsExtT' type=kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null $receiver: GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExtT' type=kotlin.Function1 origin=null - FUN name:testExtAsSimpleT visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 + FUN name:testExtAsSimpleT visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1 BLOCK_BODY CALL 'public final fun useSuspendArgT (sfn: kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null : kotlin.Int sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1, p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1, p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1 VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT 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=null - $this: GET_VAR 'callee: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimpleT.suspendConversion' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null + $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimpleT.suspendConversion' type=@[ExtensionFunctionType] kotlin.Function1 origin=null p1: GET_VAR 'p0: T of .useSuspendArgT declared in .testExtAsSimpleT.suspendConversion' type=T of .useSuspendArgT origin=null FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendArgT): kotlin.Unit [suspend] declared in .testExtAsSimpleT' type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimpleT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null - FUN name:testExtAsExtT visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 + $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimpleT' type=@[ExtensionFunctionType] kotlin.Function1 origin=null + FUN name:testExtAsExtT visibility:public modality:FINAL <> (fn:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1 BLOCK_BODY - CALL 'public final fun useSuspendExtT (sfn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun useSuspendExtT (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null : kotlin.Int - sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1, p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 + sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1, p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1 VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendExtT 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=null - $this: GET_VAR 'callee: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExtT.suspendConversion' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null + $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExtT.suspendConversion' type=@[ExtensionFunctionType] kotlin.Function1 origin=null p1: GET_VAR 'p0: T of .useSuspendExtT declared in .testExtAsExtT.suspendConversion' type=T of .useSuspendExtT origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendExtT): kotlin.Unit [suspend] declared in .testExtAsExtT' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExtT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendExtT): kotlin.Unit [suspend] declared in .testExtAsExtT' type=kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExtT' type=@[ExtensionFunctionType] kotlin.Function1 origin=null FUN name:testSimpleSAsSimpleT visibility:public modality:FINAL (fn:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit>) returnType:kotlin.Unit TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:fn index:0 type:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> @@ -169,9 +169,9 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:fn index:0 type:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> BLOCK_BODY - CALL 'public final fun useSuspendExtT (sfn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun useSuspendExtT (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null : S of .testSimpleSAsExtT - sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION + sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit>, p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendExtT @@ -179,40 +179,40 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 [operator] declared in kotlin.Function1' type=kotlin.Unit origin=null $this: GET_VAR 'callee: kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> declared in .testSimpleSAsExtT.suspendConversion' type=kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> origin=null p1: GET_VAR 'p0: T of .useSuspendExtT declared in .testSimpleSAsExtT.suspendConversion' type=T of .useSuspendExtT origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendExtT): kotlin.Unit [suspend] declared in .testSimpleSAsExtT' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null + FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendExtT): kotlin.Unit [suspend] declared in .testSimpleSAsExtT' type=kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null $receiver: GET_VAR 'fn: kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> declared in .testSimpleSAsExtT' type=kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> origin=null - FUN name:testExtSAsSimpleT visibility:public modality:FINAL (fn:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit>) returnType:kotlin.Unit + FUN name:testExtSAsSimpleT visibility:public modality:FINAL (fn:@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit>) returnType:kotlin.Unit TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> + VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> BLOCK_BODY CALL 'public final fun useSuspendArgT (sfn: kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null : S of .testExtSAsSimpleT sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit>, p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit>, p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT 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=null - $this: GET_VAR 'callee: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT.suspendConversion' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=null + $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT.suspendConversion' type=@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=null p1: GET_VAR 'p0: T of .useSuspendArgT declared in .testExtSAsSimpleT.suspendConversion' type=T of .useSuspendArgT origin=null FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendArgT): kotlin.Unit [suspend] declared in .testExtSAsSimpleT' type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=null - FUN name:testExtSAsExtT visibility:public modality:FINAL (fn:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit>) returnType:kotlin.Unit + $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT' type=@[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=null + FUN name:testExtSAsExtT visibility:public modality:FINAL (fn:@[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit>) returnType:kotlin.Unit TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> + VALUE_PARAMETER name:fn index:0 type:@[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> BLOCK_BODY - CALL 'public final fun useSuspendExtT (sfn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null + CALL 'public final fun useSuspendExtT (sfn: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit>): kotlin.Unit declared in ' type=kotlin.Unit origin=null : S of .testExtSAsExtT - sfn: BLOCK type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION - FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit>, p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] - $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> + sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION + FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> ($receiver:@[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit>, p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:callee type:@[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendExtT 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=null - $this: GET_VAR 'callee: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> declared in .testExtSAsExtT.suspendConversion' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> origin=null + $this: GET_VAR 'callee: @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> declared in .testExtSAsExtT.suspendConversion' type=@[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> origin=null p1: GET_VAR 'p0: T of .useSuspendExtT declared in .testExtSAsExtT.suspendConversion' type=T of .useSuspendExtT origin=null - FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendExtT): kotlin.Unit [suspend] declared in .testExtSAsExtT' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null - $receiver: GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> declared in .testExtSAsExtT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> origin=null + FUNCTION_REFERENCE 'local final fun suspendConversion (p0: T of .useSuspendExtT): kotlin.Unit [suspend] declared in .testExtSAsExtT' type=kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION reflectionTarget=null + $receiver: GET_VAR 'fn: @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> declared in .testExtSAsExtT' type=@[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> origin=null FUN name:testSmartCastWithSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.kt.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.kt.txt index ec434a2a7e0..d26d3800122 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.kt.txt @@ -9,7 +9,7 @@ fun test1(f: Function0) { return f.invoke() } -fun test2(f: @ExtensionFunctionType @ExtensionFunctionType Function1) { +fun test2(f: @ExtensionFunctionType Function1) { return f.invoke(p1 = "hello") } diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt index 2e60d30775d..7ba641b6e3a 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt @@ -14,12 +14,12 @@ FILE fqName: fileName:/variableAsFunctionCall.kt RETURN type=kotlin.Nothing from='public final fun test1 (f: kotlin.Function0): kotlin.Unit declared in ' CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Unit origin=INVOKE $this: GET_VAR 'f: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION - FUN name:test2 visibility:public modality:FINAL <> (f:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit - VALUE_PARAMETER name:f index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 + FUN name:test2 visibility:public modality:FINAL <> (f:@[ExtensionFunctionType] kotlin.Function1) returnType:kotlin.Unit + VALUE_PARAMETER name:f index:0 type:@[ExtensionFunctionType] kotlin.Function1 BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2 (f: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1): kotlin.Unit declared in ' + RETURN type=kotlin.Nothing from='public final fun test2 (f: @[ExtensionFunctionType] kotlin.Function1): kotlin.Unit declared in ' 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 'f: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .test2' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=VARIABLE_AS_FUNCTION + $this: GET_VAR 'f: @[ExtensionFunctionType] kotlin.Function1 declared in .test2' type=@[ExtensionFunctionType] kotlin.Function1 origin=VARIABLE_AS_FUNCTION p1: CONST String type=kotlin.String value="hello" FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY diff --git a/compiler/testData/ir/irText/firProblems/AllCandidates.fir.txt b/compiler/testData/ir/irText/firProblems/AllCandidates.fir.txt index f0afc80228e..a9652095e84 100644 --- a/compiler/testData/ir/irText/firProblems/AllCandidates.fir.txt +++ b/compiler/testData/ir/irText/firProblems/AllCandidates.fir.txt @@ -55,7 +55,7 @@ FILE fqName: fileName:/AllCandidates.kt VALUE_PARAMETER name:allCandidates index:0 type:kotlin.collections.Collection<.MyCandidate> BLOCK_BODY RETURN type=kotlin.Nothing from='private final fun allCandidatesResult (allCandidates: kotlin.collections.Collection<.MyCandidate>): .OverloadResolutionResultsImpl.allCandidatesResult?>? declared in ' - CALL 'public final fun apply (block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1): T of kotlin.apply [inline] declared in kotlin' type=.OverloadResolutionResultsImpl.allCandidatesResult?>? origin=null + CALL 'public final fun apply (block: @[ExtensionFunctionType] kotlin.Function1): T of kotlin.apply [inline] declared in kotlin' type=.OverloadResolutionResultsImpl.allCandidatesResult?>? origin=null : .OverloadResolutionResultsImpl.allCandidatesResult?>? $receiver: CALL 'public open fun nameNotFound (): .OverloadResolutionResultsImpl.OverloadResolutionResultsImpl.nameNotFound?>? declared in .OverloadResolutionResultsImpl' type=.OverloadResolutionResultsImpl.allCandidatesResult?>? origin=null : A of .allCandidatesResult? diff --git a/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.fir.txt b/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.fir.txt index c4ed0731a15..1534070b987 100644 --- a/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.fir.txt +++ b/compiler/testData/ir/irText/firProblems/typeVariableAfterBuildMap.fir.txt @@ -545,7 +545,7 @@ FILE fqName: fileName:/typeVariableAfterBuildMap.kt PROPERTY name:ORDERED_VISIBILITIES visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:ORDERED_VISIBILITIES type:kotlin.collections.Map<.Visibility, kotlin.Int> visibility:private [final] EXPRESSION_BODY - CALL 'public final fun buildMap (builderAction: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1, kotlin.Unit>): kotlin.collections.Map [inline] declared in kotlin.collections' type=kotlin.collections.Map<.Visibility, kotlin.Int> origin=null + CALL 'public final fun buildMap (builderAction: @[ExtensionFunctionType] kotlin.Function1, kotlin.Unit>): kotlin.collections.Map [inline] declared in kotlin.collections' type=kotlin.collections.Map<.Visibility, kotlin.Int> origin=null : .Visibility : kotlin.Int builderAction: FUN_EXPR type=kotlin.Function1.Visibility, kotlin.Int>, kotlin.Unit> origin=LAMBDA diff --git a/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt b/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt index a57a2b134fe..56bbb873c5c 100644 --- a/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt +++ b/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt @@ -2,7 +2,7 @@ FILE fqName: fileName:/extensionLambda.kt FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Int declared in ' - CALL 'public final fun run (block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1): R of kotlin.run [inline] declared in kotlin' type=kotlin.Int origin=null + CALL 'public final fun run (block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.run [inline] declared in kotlin' type=kotlin.Int origin=null : kotlin.String : kotlin.Int $receiver: CONST String type=kotlin.String value="42" diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt index ed4c93f35a2..7e81e71b4c3 100644 --- a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt @@ -86,7 +86,7 @@ FILE fqName: fileName:/multipleImplicitReceivers.kt VALUE_PARAMETER name:invokeImpl index:1 type:.IInvoke BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null + CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null : .A : kotlin.Int receiver: GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A @@ -95,7 +95,7 @@ FILE fqName: fileName:/multipleImplicitReceivers.kt $receiver: VALUE_PARAMETER name: type:.A BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .test' - CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null + CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null : .IFoo : kotlin.Int receiver: GET_VAR 'fooImpl: .IFoo declared in .test' type=.IFoo origin=null @@ -104,7 +104,7 @@ FILE fqName: fileName:/multipleImplicitReceivers.kt $receiver: VALUE_PARAMETER name: type:.IFoo BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .test.' - CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null + CALL 'public final fun with (receiver: T of kotlin.with, block: @[ExtensionFunctionType] kotlin.Function1): R of kotlin.with [inline] declared in kotlin' type=kotlin.Int origin=null : .IInvoke : kotlin.Int receiver: GET_VAR 'invokeImpl: .IInvoke declared in .test' type=.IInvoke origin=null diff --git a/compiler/testData/ir/irText/stubs/builtinMap.fir.txt b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt index 2df3708de14..6ec62b253cb 100644 --- a/compiler/testData/ir/irText/stubs/builtinMap.fir.txt +++ b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt @@ -16,7 +16,7 @@ FILE fqName: fileName:/builtinMap.kt pair: GET_VAR 'pair: kotlin.Pair.plus, V1 of .plus> declared in .plus' type=kotlin.Pair.plus, V1 of .plus> origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun apply (block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1): T of kotlin.apply [inline] declared in kotlin' type=java.util.LinkedHashMap.plus?, V1 of .plus?> origin=null + then: CALL 'public final fun apply (block: @[ExtensionFunctionType] kotlin.Function1): T of kotlin.apply [inline] declared in kotlin' type=java.util.LinkedHashMap.plus?, V1 of .plus?> origin=null : java.util.LinkedHashMap.plus?, V1 of .plus?> $receiver: CONSTRUCTOR_CALL 'public constructor (p0: kotlin.collections.Map?) declared in java.util.LinkedHashMap' type=java.util.LinkedHashMap.plus?, V1 of .plus?> origin=null : K1 of .plus? diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt index 6c921d41b55..de21f64cb90 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt @@ -1,5 +1,5 @@ @OptIn(markerClass = [ExperimentalTypeInference::class]) -fun scopedFlow(@BuilderInference block: @ExtensionFunctionType @ExtensionFunctionType SuspendFunction2, Unit>): Flow { +fun scopedFlow(@BuilderInference block: @ExtensionFunctionType SuspendFunction2, Unit>): Flow { return flow(block = local suspend fun FlowCollector.() { val collector: FlowCollector = flowScope(block = local suspend fun CoroutineScope.() { @@ -10,7 +10,7 @@ fun scopedFlow(@BuilderInference block: @ExtensionFunctionType @Exten ) } -fun Flow.onCompletion(action: @ExtensionFunctionType @ExtensionFunctionType SuspendFunction2, Throwable?, Unit>): Flow { +fun Flow.onCompletion(action: @ExtensionFunctionType SuspendFunction2, Throwable?, Unit>): Flow { return unsafeFlow(block = local suspend fun FlowCollector.() { val safeCollector: SafeCollector = SafeCollector(collector = ) safeCollector.invokeSafely(action = action) @@ -18,11 +18,11 @@ fun Flow.onCompletion(action: @ExtensionFunctionType @ExtensionFun ) } -suspend fun FlowCollector.invokeSafely(action: @ExtensionFunctionType @ExtensionFunctionType SuspendFunction2, Throwable?, Unit>) { +suspend fun FlowCollector.invokeSafely(action: @ExtensionFunctionType SuspendFunction2, Throwable?, Unit>) { } @OptIn(markerClass = [ExperimentalTypeInference::class]) -inline fun unsafeFlow(@BuilderInference crossinline block: @ExtensionFunctionType @ExtensionFunctionType SuspendFunction1, Unit>): Flow { +inline fun unsafeFlow(@BuilderInference crossinline block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { return TODO() } @@ -84,12 +84,12 @@ class SafeCollector : FlowCollector { } @OptIn(markerClass = [ExperimentalTypeInference::class]) -fun flow(@BuilderInference block: @ExtensionFunctionType @ExtensionFunctionType SuspendFunction1, Unit>): Flow { +fun flow(@BuilderInference block: @ExtensionFunctionType SuspendFunction1, Unit>): Flow { return TODO() } @OptIn(markerClass = [ExperimentalTypeInference::class]) -suspend fun flowScope(@BuilderInference block: @ExtensionFunctionType @ExtensionFunctionType SuspendFunction1): R { +suspend fun flowScope(@BuilderInference block: @ExtensionFunctionType SuspendFunction1): R { return TODO() } @@ -127,7 +127,7 @@ interface ReceiveChannel { } @OptIn(markerClass = [ExperimentalTypeInference::class]) -fun CoroutineScope.produce(@BuilderInference block: @ExtensionFunctionType @ExtensionFunctionType SuspendFunction1, Unit>): ReceiveChannel { +fun CoroutineScope.produce(@BuilderInference block: @ExtensionFunctionType SuspendFunction1, Unit>): ReceiveChannel { return TODO() } diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt index bc4273f3b70..d8b8c9ab8a9 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt @@ -1,14 +1,14 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt - FUN name:scopedFlow visibility:public modality:FINAL (block:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit>) returnType:.Flow.scopedFlow> + FUN name:scopedFlow visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit>) returnType:.Flow.scopedFlow> annotations: OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> + VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> annotations: BuilderInference BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun scopedFlow (block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit>): .Flow.scopedFlow> declared in ' - CALL 'public final fun flow (block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>): .Flow.flow> declared in ' type=.Flow.scopedFlow> origin=null + RETURN type=kotlin.Nothing from='public final fun scopedFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit>): .Flow.scopedFlow> declared in ' + CALL 'public final fun flow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>): .Flow.flow> declared in ' type=.Flow.scopedFlow> origin=null : R of .scopedFlow block: FUN_EXPR type=kotlin.coroutines.SuspendFunction1<.FlowCollector.scopedFlow>, kotlin.Unit> origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.FlowCollector.scopedFlow>) returnType:kotlin.Unit [suspend] @@ -16,24 +16,24 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt BLOCK_BODY VAR name:collector type:.FlowCollector [val] GET_VAR ': .FlowCollector.scopedFlow> declared in .scopedFlow.' type=.FlowCollector origin=null - CALL 'public final fun flowScope (block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>): R of .flowScope [suspend] declared in ' type=kotlin.Unit origin=null + CALL 'public final fun flowScope (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>): R of .flowScope [suspend] declared in ' type=kotlin.Unit origin=null : kotlin.Unit block: FUN_EXPR type=kotlin.coroutines.SuspendFunction1<.CoroutineScope, kotlin.Unit> origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.CoroutineScope) returnType:kotlin.Unit [suspend] $receiver: VALUE_PARAMETER name: type:.CoroutineScope BLOCK_BODY CALL 'public abstract fun invoke (p1: P1 of kotlin.coroutines.SuspendFunction2, p2: P2 of kotlin.coroutines.SuspendFunction2): R of kotlin.coroutines.SuspendFunction2 [suspend,operator] declared in kotlin.coroutines.SuspendFunction2' type=kotlin.Unit origin=null - $this: GET_VAR 'block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> declared in .scopedFlow' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> origin=VARIABLE_AS_FUNCTION + $this: GET_VAR 'block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> declared in .scopedFlow' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> origin=VARIABLE_AS_FUNCTION p1: GET_VAR ': .CoroutineScope declared in .scopedFlow..' type=.CoroutineScope origin=null p2: TYPE_OP type=.FlowCollector origin=IMPLICIT_CAST typeOperand=.FlowCollector GET_VAR 'val collector: .FlowCollector [val] declared in .scopedFlow.' type=.FlowCollector.scopedFlow> origin=null - FUN name:onCompletion visibility:public modality:FINAL ($receiver:.Flow.onCompletion>, action:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, kotlin.Throwable?, kotlin.Unit>) returnType:.Flow.onCompletion> + FUN name:onCompletion visibility:public modality:FINAL ($receiver:.Flow.onCompletion>, action:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, kotlin.Throwable?, kotlin.Unit>) returnType:.Flow.onCompletion> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] $receiver: VALUE_PARAMETER name: type:.Flow.onCompletion> - VALUE_PARAMETER name:action index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, kotlin.Throwable?, kotlin.Unit> + VALUE_PARAMETER name:action index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, kotlin.Throwable?, kotlin.Unit> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun onCompletion (action: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, kotlin.Throwable?, kotlin.Unit>): .Flow.onCompletion> declared in ' - CALL 'public final fun unsafeFlow (block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>): .Flow.unsafeFlow> [inline] declared in ' type=.Flow.onCompletion> origin=null + RETURN type=kotlin.Nothing from='public final fun onCompletion (action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, kotlin.Throwable?, kotlin.Unit>): .Flow.onCompletion> declared in ' + CALL 'public final fun unsafeFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>): .Flow.unsafeFlow> [inline] declared in ' type=.Flow.onCompletion> origin=null : T of .onCompletion block: FUN_EXPR type=kotlin.coroutines.SuspendFunction1<.FlowCollector.onCompletion>, kotlin.Unit> origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:.FlowCollector.onCompletion>) returnType:kotlin.Unit [suspend] @@ -43,24 +43,24 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt CONSTRUCTOR_CALL 'public constructor (collector: .FlowCollector.SafeCollector>) [primary] declared in .SafeCollector' type=.SafeCollector.onCompletion> origin=null : T of .onCompletion collector: GET_VAR ': .FlowCollector.onCompletion> declared in .onCompletion.' type=.FlowCollector.onCompletion> origin=null - CALL 'public final fun invokeSafely (action: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, kotlin.Throwable?, kotlin.Unit>): kotlin.Unit [suspend] declared in ' type=kotlin.Unit origin=null + CALL 'public final fun invokeSafely (action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, kotlin.Throwable?, kotlin.Unit>): kotlin.Unit [suspend] declared in ' type=kotlin.Unit origin=null : T of .onCompletion $receiver: GET_VAR 'val safeCollector: .SafeCollector [val] declared in .onCompletion.' type=.SafeCollector.onCompletion> origin=null - action: GET_VAR 'action: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, kotlin.Throwable?, kotlin.Unit> declared in .onCompletion' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, kotlin.Throwable?, kotlin.Unit> origin=null - FUN name:invokeSafely visibility:public modality:FINAL ($receiver:.FlowCollector.invokeSafely>, action:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, kotlin.Throwable?, kotlin.Unit>) returnType:kotlin.Unit [suspend] + action: GET_VAR 'action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, kotlin.Throwable?, kotlin.Unit> declared in .onCompletion' type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.onCompletion>, kotlin.Throwable?, kotlin.Unit> origin=null + FUN name:invokeSafely visibility:public modality:FINAL ($receiver:.FlowCollector.invokeSafely>, action:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, kotlin.Throwable?, kotlin.Unit>) returnType:kotlin.Unit [suspend] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] $receiver: VALUE_PARAMETER name: type:.FlowCollector.invokeSafely> - VALUE_PARAMETER name:action index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, kotlin.Throwable?, kotlin.Unit> + VALUE_PARAMETER name:action index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<.FlowCollector.invokeSafely>, kotlin.Throwable?, kotlin.Unit> BLOCK_BODY - FUN name:unsafeFlow visibility:public modality:FINAL (block:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>) returnType:.Flow.unsafeFlow> [inline] + FUN name:unsafeFlow visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>) returnType:.Flow.unsafeFlow> [inline] annotations: OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit> [crossinline] + VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit> [crossinline] annotations: BuilderInference BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun unsafeFlow (block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>): .Flow.unsafeFlow> [inline] declared in ' + RETURN type=kotlin.Nothing from='public final fun unsafeFlow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>): .Flow.unsafeFlow> [inline] declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin' type=kotlin.Nothing origin=null FUN name:onCompletion visibility:public modality:FINAL ($receiver:.Flow.onCompletion>, action:kotlin.coroutines.SuspendFunction1) returnType:IrErrorType annotations: @@ -82,7 +82,7 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt VALUE_PARAMETER name:flow index:0 type:.Flow<*> BLOCK_BODY RETURN type=kotlin.Nothing from='private final fun asFairChannel (flow: .Flow<*>): .ReceiveChannel declared in ' - CALL 'public final fun produce (block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>): .ReceiveChannel.produce> declared in ' type=.ReceiveChannel origin=null + CALL 'public final fun produce (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>): .ReceiveChannel.produce> declared in ' type=.ReceiveChannel origin=null : kotlin.Any $receiver: GET_VAR ': .CoroutineScope declared in .asFairChannel' type=.CoroutineScope origin=null block: FUN_EXPR type=kotlin.coroutines.SuspendFunction1<.ProducerScope, kotlin.Unit> origin=LAMBDA @@ -121,7 +121,7 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt VALUE_PARAMETER name:flow index:0 type:.Flow<*> BLOCK_BODY RETURN type=kotlin.Nothing from='private final fun asChannel (flow: .Flow<*>): .ReceiveChannel declared in ' - CALL 'public final fun produce (block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>): .ReceiveChannel.produce> declared in ' type=.ReceiveChannel origin=null + CALL 'public final fun produce (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>): .ReceiveChannel.produce> declared in ' type=.ReceiveChannel origin=null : kotlin.Any $receiver: GET_VAR ': .CoroutineScope declared in .asChannel' type=.CoroutineScope origin=null block: FUN_EXPR type=kotlin.coroutines.SuspendFunction1<.ProducerScope, kotlin.Unit> origin=LAMBDA @@ -190,25 +190,25 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:flow visibility:public modality:FINAL (block:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>) returnType:.Flow.flow> + FUN name:flow visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>) returnType:.Flow.flow> annotations: OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit> + VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit> annotations: BuilderInference BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun flow (block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>): .Flow.flow> declared in ' + RETURN type=kotlin.Nothing from='public final fun flow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>): .Flow.flow> declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin' type=kotlin.Nothing origin=null - FUN name:flowScope visibility:public modality:FINAL (block:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>) returnType:R of .flowScope [suspend] + FUN name:flowScope visibility:public modality:FINAL (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>) returnType:R of .flowScope [suspend] annotations: OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope> + VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope> annotations: BuilderInference BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun flowScope (block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>): R of .flowScope [suspend] declared in ' + RETURN type=kotlin.Nothing from='public final fun flowScope (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>): R of .flowScope [suspend] declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin' type=kotlin.Nothing origin=null FUN name:collect visibility:public modality:FINAL ($receiver:.Flow.collect>, action:kotlin.coroutines.SuspendFunction1.collect, kotlin.Unit>) returnType:kotlin.Unit [inline,suspend] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] @@ -308,16 +308,16 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:produce visibility:public modality:FINAL ($receiver:.CoroutineScope, block:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>) returnType:.ReceiveChannel.produce> + FUN name:produce visibility:public modality:FINAL ($receiver:.CoroutineScope, block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>) returnType:.ReceiveChannel.produce> annotations: OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass]) TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] $receiver: VALUE_PARAMETER name: type:.CoroutineScope - VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit> + VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit> annotations: BuilderInference BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun produce (block: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>): .ReceiveChannel.produce> declared in ' + RETURN type=kotlin.Nothing from='public final fun produce (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>): .ReceiveChannel.produce> declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin' type=kotlin.Nothing origin=null CLASS INTERFACE name:ProducerScope modality:ABSTRACT visibility:public superTypes:[.CoroutineScope; .SendChannel.ProducerScope>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ProducerScope.ProducerScope>