diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index 52444579a92..66b5bd05718 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -427,27 +427,17 @@ internal class Fir2IrVisitor( } } - override fun visitAnonymousFunction(anonymousFunction: FirAnonymousFunction, data: Any?): IrElement { - val irFunction = declarationStorage.getIrLocalFunction(anonymousFunction) - irFunction.setParentByParentStack().withFunction { - setFunctionContent(irFunction.descriptor, anonymousFunction) - } - return anonymousFunction.convertWithOffsets { startOffset, endOffset -> - val type = anonymousFunction.typeRef.toIrType(session, declarationStorage) - val origin = when (anonymousFunction.psi) { - is KtFunctionLiteral -> IrStatementOrigin.LAMBDA - else -> IrStatementOrigin.ANONYMOUS_FUNCTION + override fun visitAnonymousFunction(anonymousFunction: FirAnonymousFunction, data: Any?): IrElement = + anonymousFunction.convertWithOffsets { startOffset, endOffset -> + val irFunction = declarationStorage.getIrLocalFunction(anonymousFunction) + irFunction.setParentByParentStack().withFunction { + setFunctionContent(irFunction.descriptor, anonymousFunction) } - IrBlockImpl( - startOffset, endOffset, type, origin, - listOf( - irFunction, IrFunctionReferenceImpl( - startOffset, endOffset, type, irFunction.symbol, irFunction.descriptor, 0, origin - ) - ) - ) + + val type = anonymousFunction.typeRef.toIrType(session, declarationStorage) + + IrFunctionExpressionImpl(startOffset, endOffset, type, irFunction) } - } private fun IrValueParameter.setDefaultValue(firValueParameter: FirValueParameter) { val firDefaultValue = firValueParameter.defaultValue diff --git a/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt b/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt index 3cbe6768b9c..7770781209f 100644 --- a/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt +++ b/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt @@ -4,11 +4,10 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt CONSTRUCTOR visibility:public <> (runA:kotlin.Function2<.A, kotlin.String, kotlin.Unit>) returnType:.A [primary] VALUE_PARAMETER name:runA index:0 type:kotlin.Function2<.A, kotlin.String, kotlin.Unit> EXPRESSION_BODY - BLOCK type=kotlin.Function1.A, kotlin.String, kotlin.Unit>, kotlin.Function2<.A, kotlin.String, kotlin.Unit>> origin=LAMBDA + FUN_EXPR type=kotlin.Function1.A, kotlin.String, kotlin.Unit>, kotlin.Function2<.A, kotlin.String, kotlin.Unit>> FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Function2<.A, kotlin.String, kotlin.Unit> BLOCK_BODY GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - FUNCTION_REFERENCE 'local final fun (): kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A.' type=kotlin.Function1.A, kotlin.String, kotlin.Unit>, kotlin.Function2<.A, kotlin.String, kotlin.Unit>> origin=LAMBDA BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' @@ -98,4 +97,3 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - diff --git a/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt b/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt index dfc8111de33..aa2bd1a6fdf 100644 --- a/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt @@ -2,12 +2,11 @@ FILE fqName: fileName:/lambdas.kt PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1 visibility:public [final,static] EXPRESSION_BODY - BLOCK type=kotlin.Function2, kotlin.String, kotlin.Function1> origin=LAMBDA + FUN_EXPR type=kotlin.Function2, kotlin.String, kotlin.Function1> FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.Function1 VALUE_PARAMETER name:it index:0 type:kotlin.String BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'local final fun (it: kotlin.String): kotlin.Function1 declared in .test1' type=kotlin.Function2, kotlin.String, kotlin.Function1> origin=LAMBDA FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1 correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] BLOCK_BODY @@ -16,11 +15,10 @@ FILE fqName: fileName:/lambdas.kt PROPERTY name:test2 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function2 visibility:public [final,static] EXPRESSION_BODY - BLOCK type=kotlin.Function1, kotlin.Function2> origin=LAMBDA + FUN_EXPR type=kotlin.Function1, kotlin.Function2> FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Function2 BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'local final fun (): kotlin.Function2 declared in .test2' type=kotlin.Function1, kotlin.Function2> origin=LAMBDA FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function2 correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] BLOCK_BODY @@ -29,13 +27,12 @@ FILE fqName: fileName:/lambdas.kt PROPERTY name:test3 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Function2 visibility:public [final,static] EXPRESSION_BODY - BLOCK type=kotlin.Function2 origin=LAMBDA + FUN_EXPR type=kotlin.Function2 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (i:kotlin.Int, j:kotlin.Int) returnType:kotlin.Unit VALUE_PARAMETER name:i index:0 type:kotlin.Int VALUE_PARAMETER name:j index:1 type:kotlin.Int BLOCK_BODY GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - FUNCTION_REFERENCE 'local final fun (i: kotlin.Int, j: kotlin.Int): kotlin.Unit declared in .test3' type=kotlin.Function2 origin=LAMBDA FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function2 correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] BLOCK_BODY @@ -44,12 +41,11 @@ FILE fqName: fileName:/lambdas.kt PROPERTY name:test4 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Function2 visibility:public [final,static] EXPRESSION_BODY - BLOCK type=kotlin.Function2 origin=ANONYMOUS_FUNCTION + FUN_EXPR type=kotlin.Function2 FUN name: visibility:local modality:FINAL <> (i:kotlin.Int, j:kotlin.Int) returnType:kotlin.Unit VALUE_PARAMETER name:i index:0 type:kotlin.Int VALUE_PARAMETER name:j index:1 type:kotlin.Int BLOCK_BODY - FUNCTION_REFERENCE 'local final fun (i: kotlin.Int, j: kotlin.Int): kotlin.Unit declared in .test4' type=kotlin.Function2 origin=ANONYMOUS_FUNCTION FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function2 correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/badBreakContinue.fir.txt b/compiler/testData/ir/irText/expressions/badBreakContinue.fir.txt index 68e4409552a..29a7f63087a 100644 --- a/compiler/testData/ir/irText/expressions/badBreakContinue.fir.txt +++ b/compiler/testData/ir/irText/expressions/badBreakContinue.fir.txt @@ -16,12 +16,11 @@ FILE fqName: fileName:/badBreakContinue.kt condition: CONST Boolean type=kotlin.Boolean value=true body: BLOCK type=kotlin.Unit origin=null VAR name:lambda type:kotlin.Function0 [val] - BLOCK type=kotlin.Function0 origin=LAMBDA + FUN_EXPR type=kotlin.Function0 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Nothing BLOCK_BODY BREAK label=L1 loop.label=L1 CONTINUE label=L1 loop.label=L1 - FUNCTION_REFERENCE 'local final fun (): kotlin.Nothing declared in .test3' type=kotlin.Function0 origin=LAMBDA FUN name:test4 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY WHILE label=null origin=WHILE_LOOP @@ -30,4 +29,3 @@ FILE fqName: fileName:/badBreakContinue.kt WHILE label=null origin=WHILE_LOOP condition: ERROR_EXPR 'Unbound loop: continue@@@[ERROR_EXPR(Cannot bind unlabeled jump to a loop)] ' type=kotlin.Nothing body: BLOCK type=kotlin.Unit origin=null - diff --git a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt index 0291cbeab75..cf238786960 100644 --- a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt +++ b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt @@ -2,11 +2,10 @@ FILE fqName: fileName:/coercionToUnit.kt PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function0 visibility:public [final,static] EXPRESSION_BODY - BLOCK type=kotlin.Function1, kotlin.Function0> origin=LAMBDA + FUN_EXPR type=kotlin.Function1, kotlin.Function0> FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Function0 BLOCK_BODY CONST Int type=kotlin.Function0 value=42 - FUNCTION_REFERENCE 'local final fun (): kotlin.Function0 declared in .test1' type=kotlin.Function1, kotlin.Function0> origin=LAMBDA FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function0 correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] BLOCK_BODY @@ -26,4 +25,3 @@ FILE fqName: fileName:/coercionToUnit.kt CALL 'public open fun println (x: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:java.io.PrintStream? visibility:public [final,static] ' type=java.io.PrintStream? origin=GET_PROPERTY x: CONST String type=kotlin.String value="world!" - diff --git a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt index 6ab98840235..36735e2fcd2 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt @@ -26,12 +26,11 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt PROPERTY name:value visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Function0 visibility:public [final] EXPRESSION_BODY - BLOCK type=kotlin.Function0 origin=LAMBDA + FUN_EXPR type=kotlin.Function0 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.X.B) returnType:kotlin.String $this: VALUE_PARAMETER name: type:.X.B BLOCK_BODY CALL 'public final fun (): kotlin.String declared in .X.B' type=kotlin.String origin=null - FUNCTION_REFERENCE 'local final fun (): kotlin.String declared in .X.B.value' type=kotlin.Function0 origin=LAMBDA FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X.B) returnType:kotlin.Function0 correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.X.B diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt index 7a881b1c471..22f23de519b 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt @@ -43,14 +43,13 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt PROPERTY name:aLambda visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0 visibility:public [final] EXPRESSION_BODY - BLOCK type=kotlin.Function0 origin=LAMBDA + FUN_EXPR type=kotlin.Function0 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.MyEnum.Z BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null value: CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null - FUNCTION_REFERENCE 'local final fun (): kotlin.Unit declared in .MyEnum.Z.aLambda' type=kotlin.Function0 origin=LAMBDA FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Function0 correspondingProperty: PROPERTY name:aLambda visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.MyEnum.Z @@ -122,4 +121,3 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum - diff --git a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.txt b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.txt index 05ecee43e27..f191fdffbb4 100644 --- a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.txt +++ b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.txt @@ -15,13 +15,12 @@ FILE fqName: fileName:/genericConstructorCallWithTypeArguments.kt CONSTRUCTOR_CALL 'public constructor (size: kotlin.Int, init: kotlin.Function1) declared in kotlin.Array' type=kotlin.Array.testArray> origin=null : size: GET_VAR 'n: kotlin.Int declared in .testArray' type=kotlin.Int origin=null - init: BLOCK type=kotlin.Function1 origin=LAMBDA + init: FUN_EXPR type=kotlin.Function1 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Int) returnType:T of kotlin.Array VALUE_PARAMETER name:it index:0 type:kotlin.Int BLOCK_BODY CALL 'public abstract fun invoke (): T of .testArray declared in kotlin.Function0' type=T of .testArray origin=null $this: GET_VAR 'block: kotlin.Function0.testArray> [crossinline] declared in .testArray' type=kotlin.Function0.testArray> origin=null - FUNCTION_REFERENCE 'local final fun (it: kotlin.Int): T of kotlin.Array declared in .testArray' type=kotlin.Function1 origin=LAMBDA CLASS CLASS name:Box modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box TYPE_PARAMETER name:T index:0 variance: superTypes:[] diff --git a/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt index d1e570f48c4..09aa11c276b 100644 --- a/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt +++ b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt @@ -24,18 +24,15 @@ FILE fqName: fileName:/lambdaInCAO.kt BLOCK_BODY VAR name: type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Function0): kotlin.Int declared in ' type=kotlin.Int origin=null - index: BLOCK type=kotlin.Function0 origin=LAMBDA + index: FUN_EXPR type=kotlin.Function0 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - FUNCTION_REFERENCE 'local final fun (): kotlin.Unit declared in .test3' type=kotlin.Function0 origin=LAMBDA CALL 'public final fun set (index: kotlin.Function0, value: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null - index: BLOCK type=kotlin.Function0 origin=LAMBDA + index: FUN_EXPR type=kotlin.Function0 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - FUNCTION_REFERENCE 'local final fun (): kotlin.Unit declared in .test3' type=kotlin.Function0 origin=LAMBDA value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val : kotlin.Int [val] declared in .test3' type=kotlin.Int origin=null GET_VAR 'val : kotlin.Int [val] declared in .test3' type=kotlin.Int origin=null - diff --git a/compiler/testData/ir/irText/expressions/objectReference.fir.txt b/compiler/testData/ir/irText/expressions/objectReference.fir.txt index 9d44073d19a..6055dba334a 100644 --- a/compiler/testData/ir/irText/expressions/objectReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/objectReference.fir.txt @@ -78,7 +78,7 @@ FILE fqName: fileName:/objectReference.kt PROPERTY name:aLambda visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0 visibility:public [final] EXPRESSION_BODY - BLOCK type=kotlin.Function0 origin=LAMBDA + FUN_EXPR type=kotlin.Function0 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.Z) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Z BLOCK_BODY @@ -89,7 +89,6 @@ FILE fqName: fileName:/objectReference.kt value: CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - FUNCTION_REFERENCE 'local final fun (): kotlin.Unit declared in .Z.aLambda' type=kotlin.Function0 origin=LAMBDA FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Function0 correspondingProperty: PROPERTY name:aLambda visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.Z diff --git a/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.fir.txt b/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.fir.txt index 3e00733507e..62bc58ad947 100644 --- a/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.fir.txt @@ -35,11 +35,10 @@ FILE fqName: fileName:/objectReferenceInClosureInSuperConstructorCall.kt CONSTRUCTOR visibility:private <> () returnType:.Test [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor (lambda: kotlin.Function0) [primary] declared in .Base' - lambda: BLOCK type=IrErrorType origin=LAMBDA + lambda: FUN_EXPR type=IrErrorType FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType BLOCK_BODY ERROR_CALL 'Unresolved reference: Test#' type=IrErrorType - FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .Test.' type=IrErrorType origin=LAMBDA INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Test modality:FINAL visibility:public superTypes:[.Base]' FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: @@ -54,4 +53,3 @@ FILE fqName: fileName:/objectReferenceInClosureInSuperConstructorCall.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - diff --git a/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt index db89984baba..42f65b6b79b 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt @@ -3,11 +3,10 @@ FILE fqName: fileName:/samConstructors.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (): IrErrorType declared in ' ERROR_CALL 'Unresolved reference: #' type=IrErrorType - BLOCK type=IrErrorType origin=LAMBDA + FUN_EXPR type=IrErrorType FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType BLOCK_BODY GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test1' type=IrErrorType origin=LAMBDA FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:IrErrorType VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY @@ -25,12 +24,10 @@ FILE fqName: fileName:/samConstructors.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test4 (): IrErrorType declared in ' ERROR_CALL 'Unresolved reference: #' type=IrErrorType - BLOCK type=IrErrorType origin=LAMBDA + FUN_EXPR type=IrErrorType FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (a:IrErrorType, b:IrErrorType) returnType:IrErrorType VALUE_PARAMETER name:a index:0 type:IrErrorType VALUE_PARAMETER name:b index:1 type:IrErrorType BLOCK_BODY ERROR_CALL 'Unresolved reference: minus#' type=IrErrorType ERROR_CALL 'Unresolved reference: b#' type=IrErrorType - FUNCTION_REFERENCE 'local final fun (a: IrErrorType, b: IrErrorType): IrErrorType declared in .test4' type=IrErrorType origin=LAMBDA - diff --git a/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt index d8031f3ca0d..9de788d1463 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt @@ -9,19 +9,17 @@ FILE fqName: fileName:/samConversions.kt FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public open fun runStatic (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - r: BLOCK type=kotlin.Function0 origin=LAMBDA + r: FUN_EXPR type=kotlin.Function0 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun test1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null - FUNCTION_REFERENCE 'local final fun (): kotlin.Unit declared in .test1' type=kotlin.Function0 origin=LAMBDA FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public open fun runIt (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - r: BLOCK type=kotlin.Function0 origin=LAMBDA + r: FUN_EXPR type=kotlin.Function0 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun test1 (): kotlin.Unit declared in ' type=kotlin.Unit origin=null - FUNCTION_REFERENCE 'local final fun (): kotlin.Unit declared in .test2' type=kotlin.Function0 origin=LAMBDA FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY @@ -41,4 +39,3 @@ FILE fqName: fileName:/samConversions.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: GET_VAR 'b: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null - diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt index 4aa6cbf0cfa..f24d08d727b 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt @@ -2,11 +2,10 @@ FILE fqName: fileName:/variableAsFunctionCall.kt FUN name:k visibility:public modality:FINAL <> () returnType:kotlin.Function0 BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun k (): kotlin.Function0 declared in ' - BLOCK type=kotlin.Function1, kotlin.Function0> origin=LAMBDA + FUN_EXPR type=kotlin.Function1, kotlin.Function0> FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Function0 BLOCK_BODY ERROR_CALL 'Unresolved reference: this#' type=kotlin.String - FUNCTION_REFERENCE 'local final fun (): kotlin.Function0 declared in .k' type=kotlin.Function1, kotlin.Function0> origin=LAMBDA FUN name:test1 visibility:public modality:FINAL <> (f:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:f index:0 type:kotlin.Function0 BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.fir.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.fir.txt index cb5219b8bdf..b38c7943cb5 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.fir.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.fir.txt @@ -4,11 +4,10 @@ FILE fqName: fileName:/variableAsFunctionCallWithGenerics.kt correspondingProperty: PROPERTY name:gk visibility:public modality:FINAL [val] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0> declared in ' - BLOCK type=kotlin.Function1>, kotlin.Function0>> origin=LAMBDA + FUN_EXPR type=kotlin.Function1>, kotlin.Function0>> FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Function0> BLOCK_BODY ERROR_CALL 'Unresolved reference: this#' type=IrErrorType - FUNCTION_REFERENCE 'local final fun (): kotlin.Function0> declared in .' type=kotlin.Function1>, kotlin.Function0>> origin=LAMBDA FUN name:testGeneric1 visibility:public modality:FINAL <> (x:kotlin.String) returnType:T of VALUE_PARAMETER name:x index:0 type:kotlin.String BLOCK_BODY @@ -20,12 +19,11 @@ FILE fqName: fileName:/variableAsFunctionCallWithGenerics.kt correspondingProperty: PROPERTY name:kt26531Val visibility:public modality:FINAL [val] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0> declared in ' - BLOCK type=kotlin.Function0>> origin=ANONYMOUS_FUNCTION + FUN_EXPR type=kotlin.Function0>> FUN name: visibility:local modality:FINAL <> () returnType:kotlin.Function0> BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Function0> declared in .' ERROR_CALL 'Unresolved reference: this#' type=IrErrorType - FUNCTION_REFERENCE 'local final fun (): kotlin.Function0> declared in .' type=kotlin.Function0>> origin=ANONYMOUS_FUNCTION FUN name:kt26531 visibility:public modality:FINAL <> () returnType:T of BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun kt26531 (): T of declared in ' diff --git a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.txt b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.txt index ce33a809fd9..edb1db42ce1 100644 --- a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.txt +++ b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.txt @@ -64,7 +64,7 @@ FILE fqName: fileName:/destructuringInLambda.kt PROPERTY name:fn visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1<.A, kotlin.Int> visibility:public [static] EXPRESSION_BODY - BLOCK type=kotlin.Function2.A, kotlin.Int>, IrErrorType, kotlin.Function1<.A, kotlin.Int>> origin=LAMBDA + FUN_EXPR type=kotlin.Function2.A, kotlin.Int>, IrErrorType, kotlin.Function1<.A, kotlin.Int>> FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (:IrErrorType) returnType:kotlin.Function1<.A, kotlin.Int> VALUE_PARAMETER name: index:0 type:IrErrorType BLOCK_BODY @@ -74,7 +74,6 @@ FILE fqName: fileName:/destructuringInLambda.kt ERROR_CALL 'Unresolved reference: #' type=IrErrorType ERROR_CALL 'Unresolved reference: #' type=IrErrorType GET_VAR 'val y: IrErrorType [val] declared in .fn.' type=IrErrorType origin=null - FUNCTION_REFERENCE 'local final fun (: IrErrorType): kotlin.Function1<.A, kotlin.Int> declared in .fn' type=kotlin.Function2.A, kotlin.Int>, IrErrorType, kotlin.Function1<.A, kotlin.Int>> origin=LAMBDA FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function1<.A, kotlin.Int> correspondingProperty: PROPERTY name:fn visibility:public modality:FINAL [var] BLOCK_BODY @@ -86,4 +85,3 @@ FILE fqName: fileName:/destructuringInLambda.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fn type:kotlin.Function1<.A, kotlin.Int> visibility:public [static] ' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.Function1<.A, kotlin.Int> declared in .' type=kotlin.Function1<.A, kotlin.Int> origin=null - diff --git a/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt b/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt index 64fe447e3ba..fb2af9a0e8a 100644 --- a/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt +++ b/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt @@ -3,9 +3,8 @@ FILE fqName: fileName:/extensionLambda.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.Int declared in ' CALL 'public final fun run (block: kotlin.Function1, R of >): R of [inline] declared in kotlin' type=kotlin.Int origin=null - block: BLOCK type=kotlin.Function2 origin=LAMBDA + block: FUN_EXPR type=kotlin.Function2 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.Int VALUE_PARAMETER name:it index:0 type:kotlin.String BLOCK_BODY ERROR_CALL 'No getter found for R|kotlin/String.length|' type=kotlin.Int - FUNCTION_REFERENCE 'local final fun (it: kotlin.String): kotlin.Int declared in .test1' type=kotlin.Function2 origin=LAMBDA diff --git a/compiler/testData/ir/irText/lambdas/justLambda.fir.txt b/compiler/testData/ir/irText/lambdas/justLambda.fir.txt index e43bb0a3e7e..6b46ea64908 100644 --- a/compiler/testData/ir/irText/lambdas/justLambda.fir.txt +++ b/compiler/testData/ir/irText/lambdas/justLambda.fir.txt @@ -2,11 +2,10 @@ FILE fqName: fileName:/justLambda.kt PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function0 visibility:public [final,static] EXPRESSION_BODY - BLOCK type=kotlin.Function0 origin=LAMBDA + FUN_EXPR type=kotlin.Function0 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Int BLOCK_BODY CONST Int type=kotlin.Function0 value=42 - FUNCTION_REFERENCE 'local final fun (): kotlin.Int declared in .test1' type=kotlin.Function0 origin=LAMBDA FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function0 correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] BLOCK_BODY @@ -15,11 +14,10 @@ FILE fqName: fileName:/justLambda.kt PROPERTY name:test2 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function0 visibility:public [final,static] EXPRESSION_BODY - BLOCK type=kotlin.Function0 origin=LAMBDA + FUN_EXPR type=kotlin.Function0 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - FUNCTION_REFERENCE 'local final fun (): kotlin.Unit declared in .test2' type=kotlin.Function0 origin=LAMBDA FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function0 correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt index 16619582a65..fbc7d580127 100644 --- a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt @@ -85,24 +85,21 @@ FILE fqName: fileName:/multipleImplicitReceivers.kt BLOCK_BODY CALL 'public final fun with (receiver: T of , block: kotlin.Function1, R of >): R of [inline] declared in kotlin' type=kotlin.Int origin=null receiver: GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A - block: BLOCK type=kotlin.Function2<.A, .A, kotlin.Unit> origin=LAMBDA + block: FUN_EXPR type=kotlin.Function2<.A, .A, kotlin.Unit> FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:.A) returnType:kotlin.Unit VALUE_PARAMETER name:it index:0 type:.A BLOCK_BODY CALL 'public final fun with (receiver: T of , block: kotlin.Function1, R of >): R of [inline] declared in kotlin' type=kotlin.Int origin=null receiver: GET_VAR 'fooImpl: .IFoo declared in .test' type=.IFoo origin=null - block: BLOCK type=kotlin.Function2<.IFoo, .IFoo, kotlin.Unit> origin=LAMBDA + block: FUN_EXPR type=kotlin.Function2<.IFoo, .IFoo, kotlin.Unit> FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:.IFoo) returnType:kotlin.Unit VALUE_PARAMETER name:it index:0 type:.IFoo BLOCK_BODY CALL 'public final fun with (receiver: T of , block: kotlin.Function1, R of >): R of [inline] declared in kotlin' type=kotlin.Int origin=null receiver: GET_VAR 'invokeImpl: .IInvoke declared in .test' type=.IInvoke origin=null - block: BLOCK type=kotlin.Function2<.IInvoke, .IInvoke, kotlin.Unit> origin=LAMBDA + block: FUN_EXPR type=kotlin.Function2<.IInvoke, .IInvoke, kotlin.Unit> FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:.IInvoke) returnType:kotlin.Unit VALUE_PARAMETER name:it index:0 type:.IInvoke BLOCK_BODY CALL 'public open fun invoke (): kotlin.Int declared in .IInvoke' type=kotlin.Int origin=null $this: CALL 'public open fun (): .B declared in .IFoo' type=.B origin=null - FUNCTION_REFERENCE 'local final fun (it: .IInvoke): kotlin.Unit declared in .test..' type=kotlin.Function2<.IInvoke, .IInvoke, kotlin.Unit> origin=LAMBDA - FUNCTION_REFERENCE 'local final fun (it: .IFoo): kotlin.Unit declared in .test.' type=kotlin.Function2<.IFoo, .IFoo, kotlin.Unit> origin=LAMBDA - FUNCTION_REFERENCE 'local final fun (it: .A): kotlin.Unit declared in .test' type=kotlin.Function2<.A, .A, kotlin.Unit> origin=LAMBDA diff --git a/compiler/testData/ir/irText/lambdas/nonLocalReturn.fir.txt b/compiler/testData/ir/irText/lambdas/nonLocalReturn.fir.txt index d614bc793e1..6ff3939671c 100644 --- a/compiler/testData/ir/irText/lambdas/nonLocalReturn.fir.txt +++ b/compiler/testData/ir/irText/lambdas/nonLocalReturn.fir.txt @@ -2,49 +2,44 @@ FILE fqName: fileName:/nonLocalReturn.kt FUN name:test0 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun run (block: kotlin.Function0>): R of [inline] declared in kotlin' type=kotlin.Unit origin=null - block: BLOCK type=kotlin.Function0 origin=LAMBDA + block: FUN_EXPR type=kotlin.Function0 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test0' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - FUNCTION_REFERENCE 'local final fun (): kotlin.Unit declared in .test0' type=kotlin.Function0 origin=LAMBDA FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun run (block: kotlin.Function0>): R of [inline] declared in kotlin' type=kotlin.Unit origin=null - block: BLOCK type=kotlin.Function0 origin=LAMBDA + block: FUN_EXPR type=kotlin.Function0 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test1' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - FUNCTION_REFERENCE 'local final fun (): kotlin.Unit declared in .test1' type=kotlin.Function0 origin=LAMBDA FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun run (block: kotlin.Function0>): R of [inline] declared in kotlin' type=kotlin.Unit origin=null - block: BLOCK type=kotlin.Function0 origin=LAMBDA + block: FUN_EXPR type=kotlin.Function0 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test2' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - FUNCTION_REFERENCE 'local final fun (): kotlin.Unit declared in .test2' type=kotlin.Function0 origin=LAMBDA FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun run (block: kotlin.Function0>): R of [inline] declared in kotlin' type=kotlin.Unit origin=null - block: BLOCK type=kotlin.Function0 origin=LAMBDA + block: FUN_EXPR type=kotlin.Function0 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun run (block: kotlin.Function0>): R of [inline] declared in kotlin' type=kotlin.Unit origin=null - block: BLOCK type=kotlin.Function0 origin=LAMBDA + block: FUN_EXPR type=kotlin.Function0 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test3.' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - FUNCTION_REFERENCE 'local final fun (): kotlin.Unit declared in .test3.' type=kotlin.Function0 origin=LAMBDA - FUNCTION_REFERENCE 'local final fun (): kotlin.Unit declared in .test3' type=kotlin.Function0 origin=LAMBDA FUN name:testLrmFoo1 visibility:public modality:FINAL <> (ints:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ints index:0 type:kotlin.collections.List BLOCK_BODY CALL 'public final fun forEach (action: kotlin.Function1, kotlin.Unit>): kotlin.Unit [inline] declared in kotlin.collections' type=kotlin.Unit origin=null - action: BLOCK type=kotlin.Function1 origin=LAMBDA + action: FUN_EXPR type=kotlin.Function1 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Unit VALUE_PARAMETER name:it index:0 type:kotlin.Int BLOCK_BODY @@ -57,12 +52,11 @@ FILE fqName: fileName:/nonLocalReturn.kt GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit CALL 'public final fun print (message: kotlin.Int): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: GET_VAR 'it: kotlin.Int declared in .testLrmFoo1.' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun (it: kotlin.Int): kotlin.Unit declared in .testLrmFoo1' type=kotlin.Function1 origin=LAMBDA FUN name:testLrmFoo2 visibility:public modality:FINAL <> (ints:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ints index:0 type:kotlin.collections.List BLOCK_BODY CALL 'public final fun forEach (action: kotlin.Function1, kotlin.Unit>): kotlin.Unit [inline] declared in kotlin.collections' type=kotlin.Unit origin=null - action: BLOCK type=kotlin.Function1 origin=LAMBDA + action: FUN_EXPR type=kotlin.Function1 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Unit VALUE_PARAMETER name:it index:0 type:kotlin.Int BLOCK_BODY @@ -75,4 +69,3 @@ FILE fqName: fileName:/nonLocalReturn.kt GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit CALL 'public final fun print (message: kotlin.Int): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: GET_VAR 'it: kotlin.Int declared in .testLrmFoo2.' type=kotlin.Int origin=null - FUNCTION_REFERENCE 'local final fun (it: kotlin.Int): kotlin.Unit declared in .testLrmFoo2' type=kotlin.Function1 origin=LAMBDA diff --git a/compiler/testData/ir/irText/lambdas/samAdapter.fir.txt b/compiler/testData/ir/irText/lambdas/samAdapter.fir.txt index 6c08dfe045f..a9962edc48e 100644 --- a/compiler/testData/ir/irText/lambdas/samAdapter.fir.txt +++ b/compiler/testData/ir/irText/lambdas/samAdapter.fir.txt @@ -3,10 +3,9 @@ FILE fqName: fileName:/samAdapter.kt BLOCK_BODY VAR name:hello type:IrErrorType [val] ERROR_CALL 'Unresolved reference: #' type=IrErrorType - BLOCK type=IrErrorType origin=LAMBDA + FUN_EXPR type=IrErrorType FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType BLOCK_BODY ERROR_CALL 'Unresolved reference: println#' type=IrErrorType CONST String type=IrErrorType value="Hello, world!" - FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test1' type=IrErrorType origin=LAMBDA ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/testData/ir/irText/stubs/builtinMap.fir.txt b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt index 263acc3c20b..4a11043c6cb 100644 --- a/compiler/testData/ir/irText/stubs/builtinMap.fir.txt +++ b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt @@ -14,11 +14,10 @@ FILE fqName: fileName:/builtinMap.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun apply (block: kotlin.Function1, kotlin.Unit>): T of [inline] declared in kotlin' type=java.util.LinkedHashMap.plus, V1 of .plus> origin=null - block: BLOCK type=kotlin.Function2.plus, V1 of .plus>, java.util.LinkedHashMap.plus, V1 of .plus>, kotlin.Unit> origin=LAMBDA + block: FUN_EXPR type=kotlin.Function2.plus, V1 of .plus>, java.util.LinkedHashMap.plus, V1 of .plus>, kotlin.Unit> FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:java.util.LinkedHashMap.plus, V1 of .plus>) returnType:kotlin.Unit VALUE_PARAMETER name:it index:0 type:java.util.LinkedHashMap.plus, V1 of .plus> BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType ERROR_CALL 'No getter found for R|kotlin/Pair.first|' type=A of kotlin.Pair ERROR_CALL 'No getter found for R|kotlin/Pair.second|' type=B of kotlin.Pair - FUNCTION_REFERENCE 'local final fun (it: java.util.LinkedHashMap.plus, V1 of .plus>): kotlin.Unit declared in .plus' type=kotlin.Function2.plus, V1 of .plus>, java.util.LinkedHashMap.plus, V1 of .plus>, kotlin.Unit> origin=LAMBDA diff --git a/compiler/testData/ir/irText/types/intersectionType2_NI.fir.txt b/compiler/testData/ir/irText/types/intersectionType2_NI.fir.txt index 0cdad186de1..89ce4a8f2eb 100644 --- a/compiler/testData/ir/irText/types/intersectionType2_NI.fir.txt +++ b/compiler/testData/ir/irText/types/intersectionType2_NI.fir.txt @@ -80,7 +80,7 @@ FILE fqName: fileName:/intersectionType2_NI.kt RETURN type=kotlin.Nothing from='public final fun foo (): .B declared in ' CALL 'public final fun run (fn: kotlin.Function0.run>): T of .run declared in ' type=.B origin=null : - fn: BLOCK type=kotlin.Function0<.B> origin=LAMBDA + fn: FUN_EXPR type=kotlin.Function0<.B> FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:.B BLOCK_BODY VAR name:mm type:.B [val] @@ -96,4 +96,3 @@ FILE fqName: fileName:/intersectionType2_NI.kt if: CONST Boolean type=kotlin.Boolean value=true then: GET_VAR 'val nn: .C [val] declared in .foo.' type=.C origin=null GET_VAR 'val c: .B [val] declared in .foo.' type=.B origin=null - FUNCTION_REFERENCE 'local final fun (): .B declared in .foo' type=kotlin.Function0<.B> origin=LAMBDA diff --git a/compiler/testData/ir/irText/types/intersectionType2_OI.fir.txt b/compiler/testData/ir/irText/types/intersectionType2_OI.fir.txt index 68c64e7c750..a2292c2acfb 100644 --- a/compiler/testData/ir/irText/types/intersectionType2_OI.fir.txt +++ b/compiler/testData/ir/irText/types/intersectionType2_OI.fir.txt @@ -80,7 +80,7 @@ FILE fqName: fileName:/intersectionType2_OI.kt RETURN type=kotlin.Nothing from='public final fun foo (): .B declared in ' CALL 'public final fun run (fn: kotlin.Function0.run>): T of .run declared in ' type=.B origin=null : - fn: BLOCK type=kotlin.Function0<.B> origin=LAMBDA + fn: FUN_EXPR type=kotlin.Function0<.B> FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:.B BLOCK_BODY VAR name:mm type:.B [val] @@ -96,4 +96,3 @@ FILE fqName: fileName:/intersectionType2_OI.kt if: CONST Boolean type=kotlin.Boolean value=true then: GET_VAR 'val nn: .C [val] declared in .foo.' type=.C origin=null GET_VAR 'val c: .B [val] declared in .foo.' type=.B origin=null - FUNCTION_REFERENCE 'local final fun (): .B declared in .foo' type=kotlin.Function0<.B> origin=LAMBDA