From 89ffce22d898b8c771751b8101b05ba4c895b2be Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Fri, 11 Sep 2020 13:10:26 -0700 Subject: [PATCH] FIR2IR: set proper IR origin for variable as function --- .../kotlin/fir/backend/ConversionUtils.kt | 9 +- .../generators/CallAndReferenceGenerator.kt | 4 +- .../parameters/useNextParamInLambda.fir.txt | 2 +- .../augmentedAssignmentWithExpression.fir.txt | 2 +- .../boundInnerGenericConstructor.fir.txt | 98 ------------------- .../boundInnerGenericConstructor.kt | 1 + .../caoWithAdaptationForSam.fir.txt | 22 ++--- .../constructorWithAdaptedArguments.fir.txt | 2 +- .../callableReferences/kt37131.fir.txt | 2 +- .../withAdaptedArguments.fir.txt | 4 +- .../withArgumentAdaptationAndReceiver.fir.txt | 2 +- .../expressions/catchParameterAccess.fir.txt | 2 +- .../expressions/extFunInvokeAsFun.fir.txt | 4 +- .../expressions/extFunSafeInvoke.fir.txt | 2 +- .../arrayAsVarargAfterSamArgument_fi.txt | 8 +- .../samConversionsWithSmartCasts.fir.txt | 18 ++-- ...icConstructorCallWithTypeArguments.fir.txt | 2 +- .../expressions/implicitCastToNonNull.fir.txt | 2 +- .../nullCheckOnGenericLambdaReturn.fir.txt | 8 +- .../nullCheckOnLambdaReturn.fir.txt | 4 +- .../sam/arrayAsVarargAfterSamArgument.fir.txt | 8 +- .../expressions/sam/samConstructors.fir.txt | 2 +- ...ConversionInGenericConstructorCall.fir.txt | 2 +- ...versionInGenericConstructorCall_NI.fir.txt | 10 +- .../sam/samConversionToGeneric.fir.txt | 8 +- .../expressions/sam/samConversions.fir.txt | 8 +- .../sam/samConversionsWithSmartCasts.fir.txt | 26 ++--- ...endConversionOnArbitraryExpression.fir.txt | 34 +++---- .../variableAsFunctionCall.fir.txt | 4 +- .../irText/firProblems/BaseFirBuilder.fir.txt | 2 +- .../irText/firProblems/DeepCopyIrTree.fir.txt | 2 +- .../castsInsideCoroutineInference.fir.txt | 6 +- .../irText/types/intersectionType2_NI.fir.txt | 2 +- .../irText/types/intersectionType2_OI.fir.txt | 2 +- 34 files changed, 112 insertions(+), 202 deletions(-) delete mode 100644 compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.fir.txt diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt index fd4667e5950..1aad9a7df4e 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt @@ -21,6 +21,7 @@ import org.jetbrains.kotlin.fir.references.FirThisReference import org.jetbrains.kotlin.fir.references.impl.FirPropertyFromParameterResolvedNamedReference import org.jetbrains.kotlin.fir.resolve.* import org.jetbrains.kotlin.fir.resolve.calls.SyntheticPropertySymbol +import org.jetbrains.kotlin.fir.resolve.inference.isBuiltinFunctionalType import org.jetbrains.kotlin.fir.resolve.providers.FirProvider import org.jetbrains.kotlin.fir.resolve.toSymbol import org.jetbrains.kotlin.fir.scopes.ProcessorAction @@ -382,7 +383,7 @@ private val nameToOperationConventionOrigin = mutableMapOf( OperatorNameConventions.RANGE_TO to IrStatementOrigin.RANGE ) -internal fun FirReference.statementOrigin(): IrStatementOrigin? { +internal fun FirReference.statementOrigin(session: FirSession): IrStatementOrigin? { return when (this) { is FirPropertyFromParameterResolvedNamedReference -> IrStatementOrigin.INITIALIZE_PROPERTY_FROM_PARAMETER is FirResolvedNamedReference -> when (val symbol = resolvedSymbol) { @@ -401,6 +402,12 @@ internal fun FirReference.statementOrigin(): IrStatementOrigin? { else -> null } + is FirVariableSymbol -> { + if ((symbol.fir as FirVariable).returnTypeRef.coneTypeSafe()?.isBuiltinFunctionalType(session) == true) { + IrStatementOrigin.VARIABLE_AS_FUNCTION + } else + null + } else -> null } else -> null diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt index 6f8870734d0..c5664e43bd3 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt @@ -186,7 +186,7 @@ class CallAndReferenceGenerator( startOffset, endOffset, type, symbol, typeArgumentsCount = symbol.owner.typeParameters.size, valueArgumentsCount = symbol.owner.valueParameters.size, - origin = qualifiedAccess.calleeReference.statementOrigin(), + origin = qualifiedAccess.calleeReference.statementOrigin(session), superQualifierSymbol = dispatchReceiver.superQualifierSymbol(symbol) ) } @@ -227,7 +227,7 @@ class CallAndReferenceGenerator( ) is IrValueSymbol -> IrGetValueImpl( startOffset, endOffset, type, symbol, - origin = qualifiedAccess.calleeReference.statementOrigin() + origin = qualifiedAccess.calleeReference.statementOrigin(session) ) is IrEnumEntrySymbol -> IrGetEnumValueImpl(startOffset, endOffset, type, symbol) else -> generateErrorCallExpression(startOffset, endOffset, qualifiedAccess.calleeReference, type) diff --git a/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.fir.txt b/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.fir.txt index 82f49aa4f1a..eaaf0f56541 100644 --- a/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/useNextParamInLambda.fir.txt @@ -17,7 +17,7 @@ FILE fqName: fileName:/useNextParamInLambda.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun f (f1: kotlin.Function0, f2: kotlin.Function0): kotlin.String declared in ' CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.String origin=INVOKE - $this: GET_VAR 'f1: kotlin.Function0 declared in .f' type=kotlin.Function0 origin=null + $this: GET_VAR 'f1: kotlin.Function0 declared in .f' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:result type:kotlin.String [var] diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.fir.txt b/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.fir.txt index 4e06d063fe7..ec72d39ee90 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.fir.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.fir.txt @@ -48,5 +48,5 @@ FILE fqName: fileName:/augmentedAssignmentWithExpression.kt BLOCK_BODY CALL 'public final fun plusAssign (x: kotlin.Int): kotlin.Unit [operator] declared in .Host' type=kotlin.Unit origin=null $this: CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=.Host origin=INVOKE - $this: GET_VAR 'a: kotlin.Function0<.Host> declared in .test4' type=kotlin.Function0<.Host> origin=null + $this: GET_VAR 'a: kotlin.Function0<.Host> declared in .test4' type=kotlin.Function0<.Host> origin=VARIABLE_AS_FUNCTION x: CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.fir.txt deleted file mode 100644 index f318c04215a..00000000000 --- a/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.fir.txt +++ /dev/null @@ -1,98 +0,0 @@ -FILE fqName:test fileName:/boundInnerGenericConstructor.kt - CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.Foo - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> () returnType:test.Foo [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]' - CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.Foo.Inner

- TYPE_PARAMETER name:P index:0 variance: superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> ($this:test.Foo, a:T of test.Foo, b:P of test.Foo.Inner) returnType:test.Foo.Inner

[primary] - $outer: VALUE_PARAMETER name: type:test.Foo - VALUE_PARAMETER name:a index:0 type:T of test.Foo - VALUE_PARAMETER name:b index:1 type:P of test.Foo.Inner - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' - PROPERTY name:a visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:a type:T of test.Foo visibility:private [final] - EXPRESSION_BODY - GET_VAR 'a: T of test.Foo declared in test.Foo.Inner.' type=T of test.Foo origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:test.Foo.Inner

) returnType:T of test.Foo - correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:test.Foo.Inner

- BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of test.Foo declared in test.Foo.Inner' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:T of test.Foo visibility:private [final]' type=T of test.Foo origin=null - receiver: GET_VAR ': test.Foo.Inner

declared in test.Foo.Inner.' type=test.Foo.Inner

origin=null - PROPERTY name:b visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:b type:P of test.Foo.Inner visibility:private [final] - EXPRESSION_BODY - GET_VAR 'b: P of test.Foo.Inner declared in test.Foo.Inner.' type=P of test.Foo.Inner origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:test.Foo.Inner

) returnType:P of test.Foo.Inner - correspondingProperty: PROPERTY name:b visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:test.Foo.Inner

- BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): P of test.Foo.Inner declared in test.Foo.Inner' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:P of test.Foo.Inner visibility:private [final]' type=P of test.Foo.Inner origin=null - receiver: GET_VAR ': test.Foo.Inner

declared in test.Foo.Inner.' type=test.Foo.Inner

origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:foo visibility:public modality:FINAL (a:A of test.foo, b:B of test.foo, x:kotlin.Function2>) returnType:test.Foo.Inner [inline] - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] - TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:a index:0 type:A of test.foo - VALUE_PARAMETER name:b index:1 type:B of test.foo - VALUE_PARAMETER name:x index:2 type:kotlin.Function2> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (a: A of test.foo, b: B of test.foo, x: kotlin.Function2>): test.Foo.Inner [inline] declared in test' - CALL 'public abstract fun invoke (p1: P1 of kotlin.Function2, p2: P2 of kotlin.Function2): R of kotlin.Function2 [operator] declared in kotlin.Function2' type=test.Foo.Inner origin=INVOKE - $this: GET_VAR 'x: kotlin.Function2> declared in test.foo' type=kotlin.Function2> origin=null - p1: GET_VAR 'a: A of test.foo declared in test.foo' type=A of test.foo origin=null - p2: GET_VAR 'b: B of test.foo declared in test.foo' type=B of test.foo origin=null - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - VAR name:z type:test.Foo [val] - CONSTRUCTOR_CALL 'public constructor () [primary] declared in test.Foo' type=test.Foo origin=null - : kotlin.String - VAR name:foo type:test.Foo.Inner [val] - CALL 'public final fun foo (a: A of test.foo, b: B of test.foo, x: kotlin.Function2>): test.Foo.Inner [inline] declared in test' type=test.Foo.Inner origin=null - : kotlin.String - : kotlin.String - a: CONST String type=kotlin.String value="O" - b: CONST String type=kotlin.String value="K" - x: FUNCTION_REFERENCE 'public constructor (a: T of test.Foo, b: P of test.Foo.Inner) [primary] declared in test.Foo.Inner' type=kotlin.reflect.KFunction2> origin=null reflectionTarget= -

: kotlin.String - $this: GET_VAR 'val z: test.Foo [val] declared in test.box' type=test.Foo origin=null - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in test' - CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS - $this: CALL 'public final fun (): T of test.Foo declared in test.Foo.Inner' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR 'val foo: test.Foo.Inner [val] declared in test.box' type=test.Foo.Inner origin=null - other: CALL 'public final fun (): P of test.Foo.Inner declared in test.Foo.Inner' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR 'val foo: test.Foo.Inner [val] declared in test.box' type=test.Foo.Inner origin=null diff --git a/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt b/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt index 74d6002459a..d6d807a168a 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test class Foo { diff --git a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt index 1c43268e701..fe36f29fcfb 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt @@ -110,10 +110,10 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.reflect.KFunction1 [val] FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit - GET_VAR 'val tmp_1: kotlin.reflect.KFunction1 [val] declared in .test1' type=kotlin.reflect.KFunction1 origin=null + GET_VAR 'val tmp_1: kotlin.reflect.KFunction1 [val] declared in .test1' type=kotlin.reflect.KFunction1 origin=VARIABLE_AS_FUNCTION CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: ERROR_CALL 'Unresolved reference: #' type=kotlin.Int - GET_VAR 'val tmp_1: kotlin.reflect.KFunction1 [val] declared in .test1' type=kotlin.reflect.KFunction1 origin=null + GET_VAR 'val tmp_1: kotlin.reflect.KFunction1 [val] declared in .test1' type=kotlin.reflect.KFunction1 origin=VARIABLE_AS_FUNCTION other: CONST Int type=kotlin.Int value=1 FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY @@ -123,10 +123,10 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.reflect.KFunction1 [val] FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit - GET_VAR 'val tmp_3: kotlin.reflect.KFunction1 [val] declared in .test2' type=kotlin.reflect.KFunction1 origin=null + GET_VAR 'val tmp_3: kotlin.reflect.KFunction1 [val] declared in .test2' type=kotlin.reflect.KFunction1 origin=VARIABLE_AS_FUNCTION CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: ERROR_CALL 'Unresolved reference: #' type=kotlin.Int - GET_VAR 'val tmp_3: kotlin.reflect.KFunction1 [val] declared in .test2' type=kotlin.reflect.KFunction1 origin=null + GET_VAR 'val tmp_3: kotlin.reflect.KFunction1 [val] declared in .test2' type=kotlin.reflect.KFunction1 origin=VARIABLE_AS_FUNCTION other: CONST Int type=kotlin.Int value=1 FUN name:test3 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 @@ -135,16 +135,16 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.A [val] GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Function1 [val] - GET_VAR 'fn: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null + GET_VAR 'fn: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR 'val tmp_4: .A [val] declared in .test3' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo - GET_VAR 'val tmp_5: kotlin.Function1 [val] declared in .test3' type=kotlin.Function1 origin=null + GET_VAR 'val tmp_5: kotlin.Function1 [val] declared in .test3' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun get (i: .IFoo): kotlin.Int [operator] declared in ' type=kotlin.Int origin=null $receiver: GET_VAR 'val tmp_4: .A [val] declared in .test3' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo - GET_VAR 'val tmp_5: kotlin.Function1 [val] declared in .test3' type=kotlin.Function1 origin=null + GET_VAR 'val tmp_5: kotlin.Function1 [val] declared in .test3' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION other: CONST Int type=kotlin.Int value=1 FUN name:test4 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 @@ -152,13 +152,13 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.IFoo - GET_VAR 'fn: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=null + GET_VAR 'fn: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION then: BLOCK type=kotlin.Unit origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:.A [val] GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:.IFoo [val] TYPE_OP type=.IFoo origin=IMPLICIT_CAST typeOperand=.IFoo - GET_VAR 'fn: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=null + GET_VAR 'fn: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR 'val tmp_6: .A [val] declared in .test4' type=.A origin=null i: GET_VAR 'val tmp_7: .IFoo [val] declared in .test4' type=.IFoo origin=null @@ -182,12 +182,12 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR 'val tmp_8: .A [val] declared in .test5' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo - GET_VAR 'val tmp_9: kotlin.Function1 [val] declared in .test5' type=kotlin.Function1 origin=null + GET_VAR 'val tmp_9: kotlin.Function1 [val] declared in .test5' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun get (i: .IFoo): kotlin.Int [operator] declared in ' type=kotlin.Int origin=null $receiver: GET_VAR 'val tmp_8: .A [val] declared in .test5' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo - GET_VAR 'val tmp_9: kotlin.Function1 [val] declared in .test5' type=kotlin.Function1 origin=null + GET_VAR 'val tmp_9: kotlin.Function1 [val] declared in .test5' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION other: CONST Int type=kotlin.Int value=1 FUN name:test6 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.fir.txt index f90cf4c1f31..22d99c69903 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.fir.txt @@ -4,7 +4,7 @@ FILE fqName: fileName:/constructorWithAdaptedArguments.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun use (fn: kotlin.Function1): kotlin.Any declared in ' CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 [operator] declared in kotlin.Function1' type=kotlin.Any origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function1 declared in .use' type=kotlin.Function1 origin=null + $this: GET_VAR 'fn: kotlin.Function1 declared in .use' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION p1: CONST Int type=kotlin.Int value=42 CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C diff --git a/compiler/testData/ir/irText/expressions/callableReferences/kt37131.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/kt37131.fir.txt index df9e8d2d3e2..e103fdec210 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/kt37131.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/kt37131.fir.txt @@ -44,7 +44,7 @@ FILE fqName: fileName:/kt37131.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun use (fn: kotlin.Function0): kotlin.Any declared in ' CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Any origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0 declared in .use' type=kotlin.Function0 origin=null + $this: GET_VAR 'fn: kotlin.Function0 declared in .use' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:testFn visibility:public modality:FINAL <> () returnType:kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testFn (): kotlin.Any declared in ' diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.fir.txt index 1ce425aa63d..d9b00022000 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.fir.txt @@ -4,14 +4,14 @@ FILE fqName: fileName:/withAdaptedArguments.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun use (fn: kotlin.Function1): kotlin.String declared in ' CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 [operator] declared in kotlin.Function1' type=kotlin.String origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function1 declared in .use' type=kotlin.Function1 origin=null + $this: GET_VAR 'fn: kotlin.Function1 declared in .use' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION p1: CONST Int type=kotlin.Int value=1 FUN name:use0 visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.String VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun use0 (fn: kotlin.Function0): kotlin.String declared in ' CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.String origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0 declared in .use0' type=kotlin.Function0 origin=null + $this: GET_VAR 'fn: kotlin.Function0 declared in .use0' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:coerceToUnit 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/callableReferences/withArgumentAdaptationAndReceiver.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.fir.txt index b93fa1d6b6e..2033b0c24bb 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.fir.txt @@ -3,7 +3,7 @@ FILE fqName: fileName:/withArgumentAdaptationAndReceiver.kt VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 BLOCK_BODY CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 [operator] declared in kotlin.Function1' type=kotlin.Unit origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function1 declared in .use' type=kotlin.Function1 origin=null + $this: GET_VAR 'fn: kotlin.Function1 declared in .use' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION p1: CONST Int type=kotlin.Int value=1 CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host diff --git a/compiler/testData/ir/irText/expressions/catchParameterAccess.fir.txt b/compiler/testData/ir/irText/expressions/catchParameterAccess.fir.txt index 5ef7bd50035..d4e1d810076 100644 --- a/compiler/testData/ir/irText/expressions/catchParameterAccess.fir.txt +++ b/compiler/testData/ir/irText/expressions/catchParameterAccess.fir.txt @@ -5,7 +5,7 @@ FILE fqName: fileName:/catchParameterAccess.kt RETURN type=kotlin.Nothing from='public final fun test (f: kotlin.Function0): kotlin.Unit declared in ' TRY type=kotlin.Unit try: 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 .test' type=kotlin.Function0 origin=null + $this: GET_VAR 'f: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION CATCH parameter=val e: java.lang.Exception [val] declared in .test VAR name:e type:java.lang.Exception [val] THROW type=kotlin.Nothing diff --git a/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.fir.txt b/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.fir.txt index 7908d13d44c..13ced496642 100644 --- a/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.fir.txt +++ b/compiler/testData/ir/irText/expressions/extFunInvokeAsFun.fir.txt @@ -5,7 +5,7 @@ FILE fqName: fileName:/extFunInvokeAsFun.kt 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=null + $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? @@ -13,5 +13,5 @@ FILE fqName: fileName:/extFunInvokeAsFun.kt 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=null + $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/extFunSafeInvoke.fir.txt b/compiler/testData/ir/irText/expressions/extFunSafeInvoke.fir.txt index 75ec1e2a756..60d3941c3c4 100644 --- a/compiler/testData/ir/irText/expressions/extFunSafeInvoke.fir.txt +++ b/compiler/testData/ir/irText/expressions/extFunSafeInvoke.fir.txt @@ -16,7 +16,7 @@ FILE fqName: fileName:/extFunSafeInvoke.kt 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=null + $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/funInterface/arrayAsVarargAfterSamArgument_fi.txt b/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.txt index 1ba2beb0eec..f308ac1b394 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.txt @@ -52,12 +52,12 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument_fi.kt GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null CALL 'public final fun foo1 (r: .IRunnable, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null r: TYPE_OP type=.IRunnable origin=SAM_CONVERSION typeOperand=.IRunnable - GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null + GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION s: VARARG type=kotlin.Array varargElementType=kotlin.String GET_VAR 's: kotlin.String declared in .test' type=kotlin.String origin=null CALL 'public final fun foo1 (r: .IRunnable, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null r: TYPE_OP type=.IRunnable origin=SAM_CONVERSION typeOperand=.IRunnable - GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null + GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION s: VARARG type=kotlin.Array varargElementType=kotlin.String SPREAD_ELEMENT GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null @@ -103,7 +103,7 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument_fi.kt GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null CALL 'public final fun foo2 (r1: .IRunnable, r2: .IRunnable, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null r1: TYPE_OP type=.IRunnable origin=SAM_CONVERSION typeOperand=.IRunnable - GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null + GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION r2: TYPE_OP type=.IRunnable origin=SAM_CONVERSION typeOperand=.IRunnable FUN_EXPR type=kotlin.Function0 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit @@ -114,7 +114,7 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument_fi.kt GET_VAR 's: kotlin.String declared in .test' type=kotlin.String origin=null CALL 'public final fun foo2 (r1: .IRunnable, r2: .IRunnable, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null r1: TYPE_OP type=.IRunnable origin=SAM_CONVERSION typeOperand=.IRunnable - GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null + GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION r2: TYPE_OP type=.IRunnable origin=SAM_CONVERSION typeOperand=.IRunnable FUN_EXPR type=kotlin.Function0 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.txt index 86e5d5b4cdb..40e8934150e 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionsWithSmartCasts.fir.txt @@ -41,10 +41,10 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.KRunnable - GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION then: CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null r: TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable - GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:test2 visibility:public modality:FINAL <> (a:.KRunnable) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.KRunnable BLOCK_BODY @@ -60,12 +60,12 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.KRunnable - GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION then: CALL 'public final fun run2 (r1: .KRunnable, r2: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null r1: TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable - GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION r2: TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable - GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.Function0, b:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 VALUE_PARAMETER name:b index:1 type:kotlin.Function0 @@ -73,12 +73,12 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.KRunnable - GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION then: CALL 'public final fun run2 (r1: .KRunnable, r2: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null r1: TYPE_OP type=.KRunnable origin=IMPLICIT_CAST typeOperand=.KRunnable - GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION r2: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable - GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null + GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:test5 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY @@ -121,7 +121,7 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt r: TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable CALL 'public final fun id (x: T of .id): T of .id declared in ' type=kotlin.Function0 origin=null : kotlin.Function0 - x: GET_VAR 'a: kotlin.Function0 declared in .test8' type=kotlin.Function0 origin=null + x: GET_VAR 'a: kotlin.Function0 declared in .test8' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:test9 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun run1 (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.txt b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.txt index fd974469499..bfaed4bd4ca 100644 --- a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.txt +++ b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.txt @@ -20,7 +20,7 @@ FILE fqName: fileName:/genericConstructorCallWithTypeArguments.kt BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): T of .testArray declared in .testArray' CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=T of .testArray origin=INVOKE - $this: GET_VAR 'block: kotlin.Function0.testArray> [crossinline] declared in .testArray' type=kotlin.Function0.testArray> origin=null + $this: GET_VAR 'block: kotlin.Function0.testArray> [crossinline] declared in .testArray' type=kotlin.Function0.testArray> origin=VARIABLE_AS_FUNCTION CLASS CLASS name:Box modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box.Box> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] diff --git a/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt b/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt index 12c5701884f..b4218fcc45c 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt +++ b/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt @@ -72,5 +72,5 @@ FILE fqName: fileName:/implicitCastToNonNull.kt arg0: GET_VAR 'x: T of .test5 declared in .test5' type=T of .test5 origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: 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 'fn: kotlin.Function1.test5, kotlin.Unit> declared in .test5' type=kotlin.Function1.test5, kotlin.Unit> origin=null + $this: GET_VAR 'fn: kotlin.Function1.test5, kotlin.Unit> declared in .test5' type=kotlin.Function1.test5, kotlin.Unit> origin=VARIABLE_AS_FUNCTION p1: GET_VAR 'x: T of .test5 declared in .test5' type=T of .test5 origin=null diff --git a/compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.fir.txt b/compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.fir.txt index ad825322fa2..f5ad2364e7d 100644 --- a/compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.fir.txt +++ b/compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.fir.txt @@ -4,27 +4,27 @@ FILE fqName: fileName:/nullCheckOnGenericLambdaReturn.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun checkAny (fn: kotlin.Function0): kotlin.Any declared in ' CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Any origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0 declared in .checkAny' type=kotlin.Function0 origin=null + $this: GET_VAR 'fn: kotlin.Function0 declared in .checkAny' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:checkAnyN visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Any? VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun checkAnyN (fn: kotlin.Function0): kotlin.Any? declared in ' CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Any? origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0 declared in .checkAnyN' type=kotlin.Function0 origin=null + $this: GET_VAR 'fn: kotlin.Function0 declared in .checkAnyN' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:checkT visibility:public modality:FINAL (fn:kotlin.Function0.checkT>) returnType:T of .checkT TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:fn index:0 type:kotlin.Function0.checkT> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun checkT (fn: kotlin.Function0.checkT>): T of .checkT declared in ' CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=T of .checkT origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.checkT> declared in .checkT' type=kotlin.Function0.checkT> origin=null + $this: GET_VAR 'fn: kotlin.Function0.checkT> declared in .checkT' type=kotlin.Function0.checkT> origin=VARIABLE_AS_FUNCTION FUN name:checkTAny visibility:public modality:FINAL (fn:kotlin.Function0.checkTAny>) returnType:T of .checkTAny TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] VALUE_PARAMETER name:fn index:0 type:kotlin.Function0.checkTAny> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun checkTAny (fn: kotlin.Function0.checkTAny>): T of .checkTAny declared in ' CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=T of .checkTAny origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.checkTAny> declared in .checkTAny' type=kotlin.Function0.checkTAny> origin=null + $this: GET_VAR 'fn: kotlin.Function0.checkTAny> declared in .checkTAny' type=kotlin.Function0.checkTAny> origin=VARIABLE_AS_FUNCTION FUN name:id visibility:public modality:FINAL (x:T of .id) returnType:T of .id TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:x index:0 type:T of .id diff --git a/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.fir.txt b/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.fir.txt index 3cea7705876..1365a4ed250 100644 --- a/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.fir.txt +++ b/compiler/testData/ir/irText/expressions/nullCheckOnLambdaReturn.fir.txt @@ -4,13 +4,13 @@ FILE fqName: fileName:/nullCheckOnLambdaReturn.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun checkAny (fn: kotlin.Function0): kotlin.Any declared in ' CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Any origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0 declared in .checkAny' type=kotlin.Function0 origin=null + $this: GET_VAR 'fn: kotlin.Function0 declared in .checkAny' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:checkAnyN visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Any? VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun checkAnyN (fn: kotlin.Function0): kotlin.Any? declared in ' CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.Any? origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0 declared in .checkAnyN' type=kotlin.Function0 origin=null + $this: GET_VAR 'fn: kotlin.Function0 declared in .checkAnyN' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:id visibility:public modality:FINAL (x:T of .id) returnType:T of .id TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:x index:0 type:T of .id diff --git a/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt index 748fa77c30f..cfc27feb8ef 100644 --- a/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt @@ -23,12 +23,12 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt SPREAD_ELEMENT GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null ERROR_CALL 'Unresolved reference: #' type=kotlin.String? - GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null + GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public open fun foo1 (r: java.lang.Runnable?, vararg strs: kotlin.String?): kotlin.String? declared in .Test' type=kotlin.String? origin=null r: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? - GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null + GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? SPREAD_ELEMENT GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null @@ -38,12 +38,12 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? CONST String type=kotlin.String value="" ERROR_CALL 'Unresolved reference: #' type=kotlin.String? - GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null + GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public open fun foo1 (r: java.lang.Runnable?, vararg strs: kotlin.String?): kotlin.String? declared in .Test' type=kotlin.String? origin=null r: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? - GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null + GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? SPREAD_ELEMENT GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt index 76d3d8cba80..9a16e29405b 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt @@ -13,7 +13,7 @@ FILE fqName: fileName:/samConstructors.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Function0): java.lang.Runnable declared in ' TYPE_OP type=java.lang.Runnable origin=SAM_CONVERSION typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY FUN name:test3 visibility:public modality:FINAL <> () returnType:java.lang.Runnable diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt index e609956c03f..d69b6d9a33a 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.fir.txt @@ -6,7 +6,7 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall.kt CONSTRUCTOR_CALL 'public constructor (jxx: .J.C?, X of .C?>?) declared in .C' type=.C origin=null : kotlin.String? jxx: TYPE_OP type=.J.C?, X of .C?>? origin=SAM_CONVERSION typeOperand=.J.C?, X of .C?>? - GET_VAR 'f: kotlin.Function1 declared in .test1' type=kotlin.Function1 origin=null + GET_VAR 'f: kotlin.Function1 declared in .test1' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.txt index eddf1c4f215..8e3a32f2a75 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.txt @@ -9,9 +9,9 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall_NI.kt $outer: CONSTRUCTOR_CALL 'public constructor (jxx: .J.C?, X of .C?>?) declared in .C' type=.C origin=null : kotlin.String? jxx: TYPE_OP type=.J.C?, X of .C?>? origin=SAM_CONVERSION typeOperand=.J.C?, X of .C?>? - GET_VAR 'f1: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null + GET_VAR 'f1: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION jxy: TYPE_OP type=.J.C.D?>? origin=SAM_CONVERSION typeOperand=.J.C.D?>? - GET_VAR 'f2: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null + GET_VAR 'f2: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Outer> TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] @@ -87,9 +87,9 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall_NI.kt $outer: CONSTRUCTOR_CALL 'public constructor (j11: .J.Outer, T1 of .Outer>) [primary] declared in .Outer' type=.Outer origin=null : kotlin.String? j11: TYPE_OP type=.J.Outer, T1 of .Outer> origin=SAM_CONVERSION typeOperand=.J.Outer, T1 of .Outer> - GET_VAR 'f: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=null + GET_VAR 'f: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION j12: TYPE_OP type=.J.Outer.Inner> origin=SAM_CONVERSION typeOperand=.J.Outer.Inner> - GET_VAR 'g: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=null + GET_VAR 'g: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION FUN name:testGenericJavaCtor1 visibility:public modality:FINAL <> (f:kotlin.Function1) returnType:.G VALUE_PARAMETER name:f index:0 type:kotlin.Function1 BLOCK_BODY @@ -98,7 +98,7 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall_NI.kt : kotlin.String? : kotlin.Int? x: TYPE_OP type=.J.G.?, TClass of .G?>? origin=SAM_CONVERSION typeOperand=.J.G.?, TClass of .G?>? - GET_VAR 'f: kotlin.Function1 declared in .testGenericJavaCtor1' type=kotlin.Function1 origin=null + GET_VAR 'f: kotlin.Function1 declared in .testGenericJavaCtor1' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION FUN name:testGenericJavaCtor2 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt index e956025229a..7589d9b55bf 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.fir.txt @@ -59,7 +59,7 @@ FILE fqName: fileName:/samConversionToGeneric.kt CALL 'public open fun bar (j: .J.H.bar?>?): kotlin.Unit declared in .H' type=kotlin.Unit origin=null : T of .test6? j: TYPE_OP type=.J.H.bar?>? origin=SAM_CONVERSION typeOperand=.J.H.bar?>? - GET_VAR 'a: kotlin.Function1.test6, T of .test6> declared in .test6' type=kotlin.Function1.test6, T of .test6> origin=null + GET_VAR 'a: kotlin.Function1.test6, T of .test6> declared in .test6' type=kotlin.Function1.test6, T of .test6> origin=VARIABLE_AS_FUNCTION FUN name:test7 visibility:public modality:FINAL (a:kotlin.Any) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:a index:0 type:kotlin.Any @@ -77,18 +77,18 @@ FILE fqName: fileName:/samConversionToGeneric.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test8 (efn: @[ExtensionFunctionType] @[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 + GET_VAR 'efn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .test8' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=VARIABLE_AS_FUNCTION 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 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] @[ExtensionFunctionType] kotlin.Function1 declared in .test9' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=VARIABLE_AS_FUNCTION FUN name:test10 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 BLOCK_BODY CALL 'public open fun bar2x (j2x: .J2X.H.bar2x?>?): kotlin.Unit declared in .H' type=kotlin.Unit origin=null : kotlin.Int? j2x: TYPE_OP type=.J2X.H.bar2x?>? origin=SAM_CONVERSION typeOperand=.J2X.H.bar2x?>? - GET_VAR 'fn: kotlin.Function1 declared in .test10' type=kotlin.Function1 origin=null + GET_VAR 'fn: kotlin.Function1 declared in .test10' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt index f73745b3804..34c1625394f 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt @@ -33,9 +33,9 @@ FILE fqName: fileName:/samConversions.kt CALL 'public open fun run2 (r1: java.lang.Runnable?, r2: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null $this: GET_VAR ': .J declared in .test3' type=.J origin=null r1: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? - GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION r2: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? - GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:test4 visibility:public modality:FINAL <> ($receiver:.J, a:kotlin.Function0, b:kotlin.Function0, flag:kotlin.Boolean) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.J VALUE_PARAMETER name:a index:0 type:kotlin.Function0 @@ -48,7 +48,7 @@ FILE fqName: fileName:/samConversions.kt WHEN type=kotlin.Function0 origin=IF BRANCH if: GET_VAR 'flag: kotlin.Boolean declared in .test4' type=kotlin.Boolean origin=null - then: GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null + then: GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null + then: GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt index 40cc1ac952e..f5d9ee60e16 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt @@ -5,34 +5,34 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION then: CALL 'public open fun runStatic (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null r: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test1' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION then: CALL 'public open fun run1 (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null r: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION then: CALL 'public open fun run2 (r1: java.lang.Runnable?, r2: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null r1: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION r2: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.Function0, b:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 VALUE_PARAMETER name:b index:1 type:kotlin.Function0 @@ -40,13 +40,13 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt WHEN type=kotlin.Unit origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION then: CALL 'public open fun run2 (r1: java.lang.Runnable?, r2: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null r1: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable - GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION r2: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? - GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null + GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:test5 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY @@ -90,17 +90,17 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 - GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=null + GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 - GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=null + GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION FUN name:test8 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit CALL 'public open fun id (x: T of .J.id?): T of .J.id? declared in .J' type=kotlin.Function0? origin=null : kotlin.Function0? - x: GET_VAR 'a: kotlin.Function0 declared in .test8' type=kotlin.Function0 origin=null + x: GET_VAR 'a: kotlin.Function0 declared in .test8' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:test9 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public open fun run1 (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt index 3b4ee75964b..52c0cdf9b09 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt @@ -30,7 +30,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null sfn: BLOCK type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Function0 [val] - GET_VAR 'fn: kotlin.Function0 declared in .testSimple' type=kotlin.Function0 origin=null + GET_VAR 'fn: kotlin.Function0 declared in .testSimple' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> () returnType:kotlin.Unit [suspend] BLOCK_BODY @@ -53,7 +53,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt CALL 'public final fun useSuspendExt (sfn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null sfn: BLOCK type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 [val] - GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExt' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null + GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExt' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=VARIABLE_AS_FUNCTION FUN_EXPR type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int @@ -67,7 +67,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt 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 VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 [val] - GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimple' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null + GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimple' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=VARIABLE_AS_FUNCTION FUN_EXPR type=kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int @@ -81,7 +81,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt CALL 'public final fun useSuspendExt (sfn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): kotlin.Unit declared in ' type=kotlin.Unit origin=null sfn: BLOCK type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Function1 [val] - GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExt' type=kotlin.Function1 origin=null + GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExt' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION FUN_EXPR type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:kotlin.Int) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:kotlin.Int @@ -96,7 +96,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt : kotlin.Int sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Function1 [val] - GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsSimpleT' type=kotlin.Function1 origin=null + GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsSimpleT' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION FUN_EXPR type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT @@ -111,7 +111,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt : kotlin.Int sfn: BLOCK type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Function1 [val] - GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExtT' type=kotlin.Function1 origin=null + GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExtT' type=kotlin.Function1 origin=VARIABLE_AS_FUNCTION FUN_EXPR type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendExtT @@ -126,7 +126,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt : kotlin.Int sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 [val] - GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimpleT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null + GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsSimpleT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=VARIABLE_AS_FUNCTION FUN_EXPR type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT @@ -141,7 +141,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt : kotlin.Int sfn: BLOCK type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 [val] - GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExtT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null + GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .testExtAsExtT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=VARIABLE_AS_FUNCTION FUN_EXPR type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendExtT @@ -157,7 +157,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt : S of .testSimpleSAsSimpleT sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> [val] - GET_VAR 'fn: kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> declared in .testSimpleSAsSimpleT' type=kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> origin=null + GET_VAR 'fn: kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> declared in .testSimpleSAsSimpleT' type=kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> origin=VARIABLE_AS_FUNCTION FUN_EXPR type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT @@ -173,7 +173,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt : S of .testSimpleSAsExtT sfn: BLOCK type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> [val] - GET_VAR 'fn: kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> declared in .testSimpleSAsExtT' type=kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> origin=null + GET_VAR 'fn: kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> declared in .testSimpleSAsExtT' type=kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> origin=VARIABLE_AS_FUNCTION FUN_EXPR type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendExtT @@ -189,7 +189,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt : S of .testExtSAsSimpleT sfn: BLOCK type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> [val] - GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=null + GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=VARIABLE_AS_FUNCTION FUN_EXPR type=kotlin.coroutines.SuspendFunction1.useSuspendArgT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:T of .useSuspendArgT) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendArgT @@ -205,7 +205,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt : S of .testExtSAsExtT sfn: BLOCK type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION VAR IR_TEMPORARY_VARIABLE name:tmp_12 type:@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> [val] - GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> declared in .testExtSAsExtT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> origin=null + GET_VAR 'fn: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> declared in .testExtSAsExtT' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1.testExtSAsExtT, kotlin.Unit> origin=VARIABLE_AS_FUNCTION FUN_EXPR type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1.useSuspendExtT, kotlin.Unit> origin=SUSPEND_CONVERSION FUN ADAPTER_FOR_SUSPEND_CONVERSION name:suspendConversion visibility:local modality:FINAL <> (p0:T of .useSuspendExtT) returnType:kotlin.Unit [suspend] VALUE_PARAMETER ADAPTER_PARAMETER_FOR_SUSPEND_CONVERSION name:p0 index:0 type:T of .useSuspendExtT @@ -252,20 +252,20 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=CAST typeOperand=kotlin.coroutines.SuspendFunction0 - GET_VAR 'a: kotlin.Function0 declared in .testSmartCastVsSuspendConversion' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .testSmartCastVsSuspendConversion' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null sfn: TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=IMPLICIT_CAST typeOperand=kotlin.coroutines.SuspendFunction0 - GET_VAR 'a: kotlin.Function0 declared in .testSmartCastVsSuspendConversion' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .testSmartCastVsSuspendConversion' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:testSmartCastOnVarVsSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY VAR name:b type:kotlin.Function0 [var] - GET_VAR 'a: kotlin.Function0 declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null + GET_VAR 'a: kotlin.Function0 declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit TYPE_OP type=kotlin.coroutines.SuspendFunction0 origin=CAST typeOperand=kotlin.coroutines.SuspendFunction0 - GET_VAR 'var b: kotlin.Function0 [var] declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null + GET_VAR 'var b: kotlin.Function0 [var] declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION CALL 'public final fun useSuspend (sfn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null - sfn: GET_VAR 'var b: kotlin.Function0 [var] declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=null + sfn: GET_VAR 'var b: kotlin.Function0 [var] declared in .testSmartCastOnVarVsSuspendConversion' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION FUN name:testIntersectionVsSuspendConversion visibility:public modality:FINAL (x:T of .testIntersectionVsSuspendConversion) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Function0; kotlin.coroutines.SuspendFunction0] VALUE_PARAMETER name:x index:0 type:T of .testIntersectionVsSuspendConversion diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt index dfae24c2c2e..2e60d30775d 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt @@ -13,13 +13,13 @@ FILE fqName: fileName:/variableAsFunctionCall.kt BLOCK_BODY 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=null + $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 BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2 (f: @[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 'f: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .test2' type=@[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 origin=null + $this: GET_VAR 'f: @[ExtensionFunctionType] @[ExtensionFunctionType] kotlin.Function1 declared in .test2' type=@[ExtensionFunctionType] @[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/BaseFirBuilder.fir.txt b/compiler/testData/ir/irText/firProblems/BaseFirBuilder.fir.txt index 4e682908055..9d8c529a33b 100644 --- a/compiler/testData/ir/irText/firProblems/BaseFirBuilder.fir.txt +++ b/compiler/testData/ir/irText/firProblems/BaseFirBuilder.fir.txt @@ -13,7 +13,7 @@ FILE fqName: fileName:/BaseFirBuilder.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun withCapturedTypeParameters (block: kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters>): T of .BaseFirBuilder.withCapturedTypeParameters [inline] declared in .BaseFirBuilder' CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=T of .BaseFirBuilder.withCapturedTypeParameters origin=INVOKE - $this: GET_VAR 'block: kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters> declared in .BaseFirBuilder.withCapturedTypeParameters' type=kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters> origin=null + $this: GET_VAR 'block: kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters> declared in .BaseFirBuilder.withCapturedTypeParameters' type=kotlin.Function0.BaseFirBuilder.withCapturedTypeParameters> origin=VARIABLE_AS_FUNCTION FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.fir.txt b/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.fir.txt index 1d78fd43613..b24d57cf46e 100644 --- a/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.fir.txt +++ b/compiler/testData/ir/irText/firProblems/DeepCopyIrTree.fir.txt @@ -225,7 +225,7 @@ FILE fqName: fileName:/DeepCopyIrTree.kt irTypeParametersContainer: GET_VAR 'irTypeParametersContainer: .IrTypeParametersContainer declared in .withinScope' type=.IrTypeParametersContainer origin=null VAR name:result type:T of .withinScope [val] CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=T of .withinScope origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.withinScope> declared in .withinScope' type=kotlin.Function0.withinScope> origin=null + $this: GET_VAR 'fn: kotlin.Function0.withinScope> declared in .withinScope' type=kotlin.Function0.withinScope> origin=VARIABLE_AS_FUNCTION CALL 'public abstract fun leaveScope (): kotlin.Unit declared in .TypeRemapper' type=kotlin.Unit origin=null $this: GET_VAR ': .TypeRemapper declared in .withinScope' type=.TypeRemapper origin=null RETURN type=kotlin.Nothing from='public final fun withinScope (irTypeParametersContainer: .IrTypeParametersContainer, fn: kotlin.Function0.withinScope>): T of .withinScope [inline] declared in ' diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt index 83ed0324a3e..5870d75d9da 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt @@ -23,7 +23,7 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt $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=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 p1: GET_VAR ': .CoroutineScope declared in .scopedFlow..' type=.CoroutineScope origin=null p2: GET_VAR 'val collector: .FlowCollector [val] declared in .scopedFlow.' type=.FlowCollector 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> @@ -45,7 +45,7 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt 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 : T of .onCompletion $receiver: GET_VAR 'val safeCollector: .SafeCollector [val] declared in .onCompletion.' type=.SafeCollector 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 + 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=VARIABLE_AS_FUNCTION 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] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] $receiver: VALUE_PARAMETER name: type:.FlowCollector.invokeSafely> @@ -74,7 +74,7 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public abstract fun invoke (p1: P1 of kotlin.coroutines.SuspendFunction1): R of kotlin.coroutines.SuspendFunction1 [suspend,operator] declared in kotlin.coroutines.SuspendFunction1' type=kotlin.Unit origin=null - $this: GET_VAR 'action: kotlin.coroutines.SuspendFunction1 declared in .onCompletion' type=kotlin.coroutines.SuspendFunction1 origin=null + $this: GET_VAR 'action: kotlin.coroutines.SuspendFunction1 declared in .onCompletion' type=kotlin.coroutines.SuspendFunction1 origin=VARIABLE_AS_FUNCTION p1: ERROR_CALL 'Unresolved reference: #' type=IrErrorType FUN name:asFairChannel visibility:private modality:FINAL <> ($receiver:.CoroutineScope, flow:.Flow<*>) returnType:.ReceiveChannel $receiver: VALUE_PARAMETER name: type:.CoroutineScope diff --git a/compiler/testData/ir/irText/types/intersectionType2_NI.fir.txt b/compiler/testData/ir/irText/types/intersectionType2_NI.fir.txt index cbd7ebc35fc..1e896b979cf 100644 --- a/compiler/testData/ir/irText/types/intersectionType2_NI.fir.txt +++ b/compiler/testData/ir/irText/types/intersectionType2_NI.fir.txt @@ -74,7 +74,7 @@ FILE fqName: fileName:/intersectionType2_NI.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun run (fn: kotlin.Function0.run>): T of .run declared in ' CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=T of .run origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.run> declared in .run' type=kotlin.Function0.run> origin=null + $this: GET_VAR 'fn: kotlin.Function0.run> declared in .run' type=kotlin.Function0.run> origin=VARIABLE_AS_FUNCTION FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Any declared in ' diff --git a/compiler/testData/ir/irText/types/intersectionType2_OI.fir.txt b/compiler/testData/ir/irText/types/intersectionType2_OI.fir.txt index e5b607616b1..58bfaab2c38 100644 --- a/compiler/testData/ir/irText/types/intersectionType2_OI.fir.txt +++ b/compiler/testData/ir/irText/types/intersectionType2_OI.fir.txt @@ -74,7 +74,7 @@ FILE fqName: fileName:/intersectionType2_OI.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun run (fn: kotlin.Function0.run>): T of .run declared in ' CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=T of .run origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function0.run> declared in .run' type=kotlin.Function0.run> origin=null + $this: GET_VAR 'fn: kotlin.Function0.run> declared in .run' type=kotlin.Function0.run> origin=VARIABLE_AS_FUNCTION FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Any declared in '