diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt index 104ab873538..ffde27ab536 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt @@ -6,14 +6,16 @@ package org.jetbrains.kotlin.fir.resolve import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.declarations.expandedConeType +import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.render +import org.jetbrains.kotlin.fir.service import org.jetbrains.kotlin.fir.symbols.* import org.jetbrains.kotlin.fir.symbols.impl.FirTypeAliasSymbol import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.fir.types.impl.ConeAbbreviatedTypeImpl import org.jetbrains.kotlin.fir.types.impl.ConeClassTypeImpl import org.jetbrains.kotlin.fir.types.impl.ConeTypeParameterTypeImpl +import org.jetbrains.kotlin.fir.types.impl.FirResolvedTypeRefImpl import org.jetbrains.kotlin.types.Variance import org.jetbrains.kotlin.utils.addToStdlib.safeAs @@ -136,3 +138,22 @@ fun T.withArguments(arguments: Array error("Not supported: $this: ${this.render()}") } } + +fun FirFunction.constructFunctionalTypeRef(session: FirSession): FirResolvedTypeRef { + val receiverTypeRef = when (this) { + is FirNamedFunction -> receiverTypeRef + is FirAnonymousFunction -> receiverTypeRef + else -> null + } + val receiverType = receiverTypeRef?.coneTypeUnsafe() + val parameters = valueParameters.map { + it.returnTypeRef.coneTypeSafe() ?: ConeKotlinErrorType("No type for parameter") + } + val rawReturnType = (this as FirTypedDeclaration).returnTypeRef.coneTypeUnsafe() + val receiverAndParameterTypes = listOfNotNull(receiverType) + parameters + listOf(rawReturnType) + + val functionalTypeId = StandardClassIds.byName("Function${receiverAndParameterTypes.size - 1}") + val functionalType = functionalTypeId(session.service()).constructType(receiverAndParameterTypes.toTypedArray(), isNullable = false) + + return FirResolvedTypeRefImpl(session, psi, functionalType) +} diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/PostponedArguments.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/PostponedArguments.kt index ce1feb3dbdf..07389b2d66a 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/PostponedArguments.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/PostponedArguments.kt @@ -129,7 +129,7 @@ private fun extraLambdaInfo( return ResolvedLambdaAtom(argument, isSuspend, receiverType, parameters, returnType, typeVariable.takeIf { newTypeVariableUsed }) } -private fun extractLambdaInfoFromFunctionalType( +internal fun extractLambdaInfoFromFunctionalType( expectedType: ConeKotlinType?, expectedTypeRef: FirTypeRef, argument: FirAnonymousFunction diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/PostponedArgumentsAnalyzer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/PostponedArgumentsAnalyzer.kt index 78243fb809a..e6e16f5e7aa 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/PostponedArgumentsAnalyzer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/PostponedArgumentsAnalyzer.kt @@ -27,6 +27,7 @@ interface LambdaAnalyzer { receiverType: ConeKotlinType?, parameters: List, expectedReturnType: ConeKotlinType?, // null means, that return type is not proper i.e. it depends on some type variables + rawReturnType: ConeKotlinType, stubsForPostponedVariables: Map ): Pair, InferenceSession> } @@ -93,6 +94,7 @@ class PostponedArgumentsAnalyzer( receiver, parameters, expectedTypeForReturnArguments, + rawReturnType, stubsForPostponedVariables ) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirBodyResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirBodyResolveTransformer.kt index 06cf05968a1..7b81f7438a3 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirBodyResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirBodyResolveTransformer.kt @@ -423,12 +423,78 @@ open class FirBodyResolveTransformer(val session: FirSession, val implicitTypeOn } override fun transformAnonymousFunction(anonymousFunction: FirAnonymousFunction, data: Any?): CompositeTransformResult { - if (data == null) return anonymousFunction.compose() - if (data is LambdaResolution) return transformAnonymousFunction(anonymousFunction, data).compose() - return super.transformAnonymousFunction(anonymousFunction, data) + return when (data) { + null -> { + anonymousFunction.compose() + } + is LambdaResolution -> { + transformAnonymousFunctionWithLambdaResolution(anonymousFunction, data).compose() + } + is FirTypeRef -> { + val resolvedLambdaAtom = (data as? FirResolvedTypeRef)?.let { + extractLambdaInfoFromFunctionalType( + it.type, it, anonymousFunction + ) + } + var af = super.transformAnonymousFunction(anonymousFunction, data).single as FirAnonymousFunction + val valueParameters = + if (resolvedLambdaAtom == null) af.valueParameters + else { + val singleParameterType = resolvedLambdaAtom.parameters.singleOrNull() + val itParam = when { + af.valueParameters.isEmpty() && singleParameterType != null -> + FirValueParameterImpl( + session, + null, + Name.identifier("it"), + FirResolvedTypeRefImpl(session, null, singleParameterType, emptyList()), + defaultValue = null, + isCrossinline = false, + isNoinline = false, + isVararg = false + ) + else -> null + } + if (itParam != null) { + listOf(itParam) + } else { + af.valueParameters.mapIndexed { index, param -> + if (param.returnTypeRef is FirResolvedTypeRef) { + param + } else { + param.transformReturnTypeRef( + StoreType, + param.returnTypeRef.resolvedTypeFromPrototype( + resolvedLambdaAtom.parameters[index] + ) + ) + param + } + } + } + + } + af = af.copy( + receiverTypeRef = af.receiverTypeRef?.takeIf { it !is FirImplicitTypeRef } + ?: resolvedLambdaAtom?.receiver?.let { af.receiverTypeRef?.resolvedTypeFromPrototype(it) }, + valueParameters = valueParameters, + returnTypeRef = (af.returnTypeRef as? FirResolvedTypeRef) + ?: resolvedLambdaAtom?.returnType?.let { af.returnTypeRef.resolvedTypeFromPrototype(it) } + ?: af.body?.resultType?.takeIf { af.returnTypeRef is FirImplicitTypeRef } + ?: FirErrorTypeRefImpl(session, af.psi, "No result type for lambda") + ) + af.replaceTypeRef(af.constructFunctionalTypeRef(session)) + af.compose() + } + else -> { + super.transformAnonymousFunction(anonymousFunction, data) + } + } } - fun transformAnonymousFunction(anonymousFunction: FirAnonymousFunction, lambdaResolution: LambdaResolution): FirAnonymousFunction { + private fun transformAnonymousFunctionWithLambdaResolution( + anonymousFunction: FirAnonymousFunction, lambdaResolution: LambdaResolution + ): FirAnonymousFunction { val receiverTypeRef = anonymousFunction.receiverTypeRef fun transform(): FirAnonymousFunction { return withScopeCleanup(scopes) { @@ -559,6 +625,7 @@ open class FirBodyResolveTransformer(val session: FirSession, val implicitTypeOn receiverType: ConeKotlinType?, parameters: List, expectedReturnType: ConeKotlinType?, + rawReturnType: ConeKotlinType, stubsForPostponedVariables: Map ): Pair, InferenceSession> { @@ -582,10 +649,10 @@ open class FirBodyResolveTransformer(val session: FirSession, val implicitTypeOn valueParameters = lambdaArgument.valueParameters.mapIndexed { index, parameter -> parameter.transformReturnTypeRef(StoreType, parameter.returnTypeRef.resolvedTypeFromPrototype(parameters[index])) parameter - } + listOfNotNull(itParam) + } + listOfNotNull(itParam), + returnTypeRef = lambdaArgument.returnTypeRef.resolvedTypeFromPrototype(rawReturnType) ) - val expectedReturnTypeRef = expectedReturnType?.let { newLambdaExpression.returnTypeRef.resolvedTypeFromPrototype(it) } replacements[lambdaArgument] = newLambdaExpression.transformSingle(this@FirBodyResolveTransformer, LambdaResolution(expectedReturnTypeRef)) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirCallCompleterTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirCallCompleterTransformer.kt index 8a2545f6f29..fe294fe6bdf 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirCallCompleterTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirCallCompleterTransformer.kt @@ -7,16 +7,18 @@ package org.jetbrains.kotlin.fir.resolve.transformers import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.copy +import org.jetbrains.kotlin.fir.declarations.FirAnonymousFunction import org.jetbrains.kotlin.fir.declarations.FirCallableMemberDeclaration +import org.jetbrains.kotlin.fir.declarations.FirDeclaration import org.jetbrains.kotlin.fir.expressions.FirFunctionCall import org.jetbrains.kotlin.fir.expressions.FirStatement import org.jetbrains.kotlin.fir.references.FirResolvedCallableReferenceImpl import org.jetbrains.kotlin.fir.resolve.calls.FirNamedReferenceWithCandidate +import org.jetbrains.kotlin.fir.resolve.constructFunctionalTypeRef import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutor import org.jetbrains.kotlin.fir.resolve.substitution.substituteOrNull import org.jetbrains.kotlin.fir.scopes.impl.withReplacedConeType -import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef -import org.jetbrains.kotlin.fir.types.FirTypeProjectionWithVariance +import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.fir.types.impl.ConeTypeParameterTypeImpl import org.jetbrains.kotlin.fir.types.impl.FirResolvedTypeRefImpl import org.jetbrains.kotlin.fir.types.impl.FirTypeProjectionWithVarianceImpl @@ -82,4 +84,21 @@ class FirCallCompleterTransformer( } + override fun transformAnonymousFunction( + anonymousFunction: FirAnonymousFunction, + data: Nothing? + ): CompositeTransformResult { + val initialType = anonymousFunction.returnTypeRef.coneTypeSafe() + if (initialType != null) { + val finalType = finalSubstitutor.substituteOrNull(initialType) + + val resultType = anonymousFunction.returnTypeRef.withReplacedConeType(session, finalType) + + anonymousFunction.transformReturnTypeRef(StoreType, resultType) + + anonymousFunction.replaceTypeRef(anonymousFunction.constructFunctionalTypeRef(session)) + } + return super.transformAnonymousFunction(anonymousFunction, data) + } + } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/cast.kt b/compiler/fir/resolve/testData/resolve/cast.kt new file mode 100644 index 00000000000..eb1c8be7d0b --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/cast.kt @@ -0,0 +1,7 @@ +val x = 1 +val y = 2 as Any + +val f = fun() = 3 as Any +val g = {} +val h: (String) -> Boolean = { _ -> false } +val hError = { _ -> true } \ No newline at end of file diff --git a/compiler/fir/resolve/testData/resolve/cast.txt b/compiler/fir/resolve/testData/resolve/cast.txt new file mode 100644 index 00000000000..88f49f9312c --- /dev/null +++ b/compiler/fir/resolve/testData/resolve/cast.txt @@ -0,0 +1,25 @@ +FILE: cast.kt + public final val x: R|kotlin/Int| = Int(1) + public get(): R|kotlin/Int| + public final val y: R|kotlin/Any| = (Int(2) as R|kotlin/Any|) + public get(): R|kotlin/Any| + public final val f: R|kotlin/Function0| = fun (): R|kotlin/Any| { + ^ (Int(3) as R|kotlin/Any|) + } + + public get(): R|kotlin/Function0| + public final val g: R|kotlin/Function0| = fun (): R|kotlin/Unit| { + Unit + } + + public get(): R|kotlin/Function0| + public final val h: R|kotlin/Function1| = fun R|kotlin/Function1|.(_: R|kotlin/String|): R|kotlin/Function1| { + Boolean(false) + } + + public get(): R|kotlin/Function1| + public final val hError: R|kotlin/Function1| = fun (_: R|class error: No type for parameter|): R|kotlin/Boolean| { + Boolean(true) + } + + public get(): R|kotlin/Function1| diff --git a/compiler/fir/resolve/testData/resolve/stdlib/functionX.txt b/compiler/fir/resolve/testData/resolve/stdlib/functionX.txt index ee2b6312de4..9cc28c32760 100644 --- a/compiler/fir/resolve/testData/resolve/stdlib/functionX.txt +++ b/compiler/fir/resolve/testData/resolve/stdlib/functionX.txt @@ -4,7 +4,7 @@ FILE: functionX.kt } public get(): R|kotlin/jvm/functions/Function0| - public final val y: R|kotlin/Function1| = fun R|kotlin/Function1|.(): R|kotlin/Function1| { + public final val y: R|kotlin/Function1| = fun R|kotlin/Function1|.(it: R|kotlin/String|): R|kotlin/Function1| { # } diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirResolveTestCaseGenerated.java b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirResolveTestCaseGenerated.java index 1abef9bda4e..22f035ff7a0 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirResolveTestCaseGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirResolveTestCaseGenerated.java @@ -29,6 +29,11 @@ public class FirResolveTestCaseGenerated extends AbstractFirResolveTestCase { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/fir/resolve/testData/resolve"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true, "stdlib"); } + @TestMetadata("cast.kt") + public void testCast() throws Exception { + runTest("compiler/fir/resolve/testData/resolve/cast.kt"); + } + @TestMetadata("companion.kt") public void testCompanion() throws Exception { runTest("compiler/fir/resolve/testData/resolve/companion.kt"); diff --git a/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt b/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt index 1f54ce384ca..5ee0bc24106 100644 --- a/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt +++ b/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt @@ -4,11 +4,11 @@ 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.Function2<.A, kotlin.String, kotlin.Unit> origin=LAMBDA + BLOCK type=kotlin.Function1.A, kotlin.String, kotlin.Unit>, kotlin.Function2<.A, kotlin.String, kotlin.Unit>> origin=LAMBDA 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.Function2<.A, kotlin.String, kotlin.Unit> origin=LAMBDA + 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]' diff --git a/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt b/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt index 7323771867b..dfc8111de33 100644 --- a/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt @@ -2,11 +2,12 @@ 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.Function1 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Function1 + BLOCK type=kotlin.Function2, kotlin.String, kotlin.Function1> origin=LAMBDA + 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 (): kotlin.Function1 declared in .test1' type=kotlin.Function1 origin=LAMBDA + 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 @@ -15,43 +16,42 @@ 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.Function2 origin=LAMBDA + BLOCK type=kotlin.Function1, kotlin.Function2> origin=LAMBDA 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.Function2 origin=LAMBDA + 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 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function2 declared in ' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function2 visibility:public [final,static] ' type=kotlin.Function2 origin=null PROPERTY name:test3 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test3 type:IrErrorType visibility:public [final,static] + FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Function2 visibility:public [final,static] EXPRESSION_BODY - BLOCK type=IrErrorType origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (i:kotlin.Int, j:kotlin.Int) returnType:IrErrorType + BLOCK type=kotlin.Function2 origin=LAMBDA + 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): IrErrorType declared in .test3' type=IrErrorType origin=LAMBDA - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + 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 - RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function2 declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Function2 visibility:public [final,static] ' type=kotlin.Function2 origin=null PROPERTY name:test4 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test4 type:IrErrorType visibility:public [final,static] + FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Function2 visibility:public [final,static] EXPRESSION_BODY - BLOCK type=IrErrorType origin=ANONYMOUS_FUNCTION + BLOCK type=kotlin.Function2 origin=ANONYMOUS_FUNCTION 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=IrErrorType origin=ANONYMOUS_FUNCTION - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + 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 - RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null - + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function2 declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Function2 visibility:public [final,static] ' type=kotlin.Function2 origin=null diff --git a/compiler/testData/ir/irText/expressions/badBreakContinue.fir.txt b/compiler/testData/ir/irText/expressions/badBreakContinue.fir.txt index 7fe538ebd14..68e4409552a 100644 --- a/compiler/testData/ir/irText/expressions/badBreakContinue.fir.txt +++ b/compiler/testData/ir/irText/expressions/badBreakContinue.fir.txt @@ -15,13 +15,13 @@ FILE fqName: fileName:/badBreakContinue.kt WHILE label=L1 origin=WHILE_LOOP condition: CONST Boolean type=kotlin.Boolean value=true body: BLOCK type=kotlin.Unit origin=null - VAR name:lambda type:IrErrorType [val] - BLOCK type=IrErrorType origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + VAR name:lambda type:kotlin.Function0 [val] + BLOCK type=kotlin.Function0 origin=LAMBDA + 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 (): IrErrorType declared in .test3' type=IrErrorType origin=LAMBDA + 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 diff --git a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt index b6d8de41f0e..0291cbeab75 100644 --- a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt +++ b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt @@ -2,11 +2,11 @@ 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.Function0 origin=LAMBDA + BLOCK type=kotlin.Function1, kotlin.Function0> origin=LAMBDA 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.Function0 origin=LAMBDA + 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 diff --git a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt index 13b2f8790a7..85871384156 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt @@ -24,20 +24,20 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.String visibility:public [final] ' type=kotlin.String origin=null receiver: GET_VAR ': .X.B declared in .X.B.' type=.X.B origin=null PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:IrErrorType visibility:public [final] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Function0 visibility:public [final] EXPRESSION_BODY - BLOCK type=IrErrorType origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.X.B) returnType:IrErrorType + BLOCK type=kotlin.Function0 origin=LAMBDA + 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 (): IrErrorType declared in .X.B.value' type=IrErrorType origin=LAMBDA - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X.B) returnType:IrErrorType + 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 BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .X.B' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0 declared in .X.B' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Function0 visibility:public [final] ' type=kotlin.Function0 origin=null receiver: GET_VAR ': .X.B declared in .X.B.' type=.X.B origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt index fe3a1deb279..7a881b1c471 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt @@ -41,22 +41,22 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt value: CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null PROPERTY name:aLambda visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:aLambda type:IrErrorType visibility:public [final] + FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0 visibility:public [final] EXPRESSION_BODY - BLOCK type=IrErrorType origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.MyEnum.Z) returnType:IrErrorType + BLOCK type=kotlin.Function0 origin=LAMBDA + 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 (): IrErrorType declared in .MyEnum.Z.aLambda' type=IrErrorType origin=LAMBDA - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:IrErrorType + 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 BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .MyEnum.Z' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aLambda type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0 declared in .MyEnum.Z' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0 visibility:public [final] ' type=kotlin.Function0 origin=null receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z.' type=.MyEnum.Z origin=null PROPERTY name:anObject visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:anObject type:kotlin.Any visibility:public [final] diff --git a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.txt b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.txt index 6895291948e..682d8527fb8 100644 --- a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.txt +++ b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.txt @@ -15,12 +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=T of kotlin.Array origin=LAMBDA + init: BLOCK type=kotlin.Function1 origin=LAMBDA 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 ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'local final fun (it: kotlin.Int): T of kotlin.Array declared in .testArray' type=T of kotlin.Array origin=LAMBDA + 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 e88937e14e6..d1e570f48c4 100644 --- a/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt +++ b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt @@ -24,17 +24,17 @@ 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.Unit origin=LAMBDA + index: BLOCK type=kotlin.Function0 origin=LAMBDA 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.Unit origin=LAMBDA + 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.Unit origin=LAMBDA + index: BLOCK type=kotlin.Function0 origin=LAMBDA 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.Unit origin=LAMBDA + 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 edc9012202b..9d44073d19a 100644 --- a/compiler/testData/ir/irText/expressions/objectReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/objectReference.fir.txt @@ -76,10 +76,10 @@ FILE fqName: fileName:/objectReference.kt public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:aLambda visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:aLambda type:IrErrorType visibility:public [final] + FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0 visibility:public [final] EXPRESSION_BODY - BLOCK type=IrErrorType origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.Z) returnType:IrErrorType + BLOCK type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.Z) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Z BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null @@ -89,13 +89,13 @@ 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 (): IrErrorType declared in .Z.aLambda' type=IrErrorType origin=LAMBDA - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Z) returnType:IrErrorType + 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 BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Z' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aLambda type:IrErrorType visibility:public [final] ' type=IrErrorType origin=null + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0 declared in .Z' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0 visibility:public [final] ' type=kotlin.Function0 origin=null receiver: GET_VAR ': .Z declared in .Z.' type=.Z origin=null PROPERTY name:anObject visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:anObject type:kotlin.Any visibility:public [final] diff --git a/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt index b4e570b964f..d8031f3ca0d 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt @@ -9,19 +9,19 @@ 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=IrErrorType origin=LAMBDA + r: BLOCK type=kotlin.Function0 origin=LAMBDA 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=IrErrorType origin=LAMBDA + 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=IrErrorType origin=LAMBDA + r: BLOCK type=kotlin.Function0 origin=LAMBDA 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=IrErrorType origin=LAMBDA + 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 diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt index 0f99748cec0..bb3905d5da9 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt @@ -2,11 +2,11 @@ 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.Function0 origin=LAMBDA + BLOCK type=kotlin.Function1, kotlin.Function0> origin=LAMBDA 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.Function0 origin=LAMBDA + 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:IrErrorType 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 13b1dfef20e..fd7733da08e 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.fir.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.fir.txt @@ -4,11 +4,11 @@ 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.Function0> origin=LAMBDA + BLOCK type=kotlin.Function1>, kotlin.Function0>> origin=LAMBDA 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.Function0> origin=LAMBDA + 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:IrErrorType VALUE_PARAMETER name:x index:0 type:kotlin.String BLOCK_BODY @@ -19,12 +19,12 @@ 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 + BLOCK type=kotlin.Function0>> origin=ANONYMOUS_FUNCTION 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 + FUNCTION_REFERENCE 'local final fun (): kotlin.Function0> declared in .' type=kotlin.Function0>> origin=ANONYMOUS_FUNCTION FUN name:kt26531 visibility:public modality:FINAL <> () returnType:IrErrorType BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun kt26531 (): IrErrorType declared in ' diff --git a/compiler/testData/ir/irText/lambdas/anonymousFunction.fir.txt b/compiler/testData/ir/irText/lambdas/anonymousFunction.fir.txt deleted file mode 100644 index e865caeb9c5..00000000000 --- a/compiler/testData/ir/irText/lambdas/anonymousFunction.fir.txt +++ /dev/null @@ -1,15 +0,0 @@ -FILE fqName: fileName:/anonymousFunction.kt - PROPERTY name:anonymous visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:anonymous type:IrErrorType visibility:public [final,static] - EXPRESSION_BODY - BLOCK type=IrErrorType origin=ANONYMOUS_FUNCTION - FUN name: visibility:local modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null - FUNCTION_REFERENCE 'local final fun (): kotlin.Unit declared in .anonymous' type=IrErrorType origin=ANONYMOUS_FUNCTION - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType - correspondingProperty: PROPERTY name:anonymous visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anonymous type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null - diff --git a/compiler/testData/ir/irText/lambdas/anonymousFunction.kt b/compiler/testData/ir/irText/lambdas/anonymousFunction.kt index 60dc65084ac..f9346768fbc 100644 --- a/compiler/testData/ir/irText/lambdas/anonymousFunction.kt +++ b/compiler/testData/ir/irText/lambdas/anonymousFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_RUNTIME val anonymous = fun() { println() } \ No newline at end of file diff --git a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.txt b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.txt index ad0fc5334c0..9a892f0c066 100644 --- a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.txt +++ b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.txt @@ -68,7 +68,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.Function1<.A, kotlin.Int> origin=LAMBDA + BLOCK type=kotlin.Function2.A, kotlin.Int>, IrErrorType, kotlin.Function1<.A, kotlin.Int>> origin=LAMBDA 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 @@ -78,7 +78,7 @@ 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.Function1<.A, kotlin.Int> origin=LAMBDA + 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 diff --git a/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt b/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt index 380334791d4..64fe447e3ba 100644 --- a/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt +++ b/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt @@ -3,10 +3,9 @@ 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=IrErrorType origin=LAMBDA + block: BLOCK type=kotlin.Function2 origin=LAMBDA 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=IrErrorType origin=LAMBDA - + 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 75696e3548e..e43bb0a3e7e 100644 --- a/compiler/testData/ir/irText/lambdas/justLambda.fir.txt +++ b/compiler/testData/ir/irText/lambdas/justLambda.fir.txt @@ -1,28 +1,27 @@ FILE fqName: fileName:/justLambda.kt PROPERTY name:test1 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] + FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function0 visibility:public [final,static] EXPRESSION_BODY - BLOCK type=IrErrorType origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Int BLOCK_BODY - CONST Int type=IrErrorType value=42 - FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .test1' type=IrErrorType origin=LAMBDA - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + 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 - RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0 declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function0 visibility:public [final,static] ' type=kotlin.Function0 origin=null PROPERTY name:test2 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] + FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function0 visibility:public [final,static] EXPRESSION_BODY - BLOCK type=IrErrorType origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:IrErrorType + BLOCK type=kotlin.Function0 origin=LAMBDA + 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 (): IrErrorType declared in .test2' type=IrErrorType origin=LAMBDA - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + 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 - RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:IrErrorType visibility:public [final,static] ' type=IrErrorType origin=null - + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0 declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function0 visibility:public [final,static] ' type=kotlin.Function0 origin=null diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt index cf6f947e18d..12437f100dd 100644 --- a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt @@ -85,24 +85,23 @@ 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.Nothing origin=null receiver: GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A - block: BLOCK type=IrErrorType origin=LAMBDA + block: BLOCK type=kotlin.Function2<.A, .A, kotlin.Nothing> origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:.A) returnType:kotlin.Nothing 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.Nothing origin=null receiver: GET_VAR 'fooImpl: .IFoo declared in .test' type=.IFoo origin=null - block: BLOCK type=IrErrorType origin=LAMBDA + block: BLOCK type=kotlin.Function2<.IFoo, .IFoo, kotlin.Nothing> origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:.IFoo) returnType:kotlin.Nothing 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.Nothing origin=null receiver: GET_VAR 'invokeImpl: .IInvoke declared in .test' type=.IInvoke origin=null - block: BLOCK type=IrErrorType origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:.IInvoke) returnType:IrErrorType + block: BLOCK type=kotlin.Function2<.IInvoke, .IInvoke, kotlin.Nothing> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:.IInvoke) returnType:kotlin.Nothing VALUE_PARAMETER name:it index:0 type:.IInvoke BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'local final fun (it: .IInvoke): IrErrorType declared in .test..' type=IrErrorType origin=LAMBDA - FUNCTION_REFERENCE 'local final fun (it: .IFoo): kotlin.Nothing declared in .test.' type=IrErrorType origin=LAMBDA - FUNCTION_REFERENCE 'local final fun (it: .A): kotlin.Nothing declared in .test' type=IrErrorType origin=LAMBDA - + FUNCTION_REFERENCE 'local final fun (it: .IInvoke): kotlin.Nothing declared in .test..' type=kotlin.Function2<.IInvoke, .IInvoke, kotlin.Nothing> origin=LAMBDA + FUNCTION_REFERENCE 'local final fun (it: .IFoo): kotlin.Nothing declared in .test.' type=kotlin.Function2<.IFoo, .IFoo, kotlin.Nothing> origin=LAMBDA + FUNCTION_REFERENCE 'local final fun (it: .A): kotlin.Nothing declared in .test' type=kotlin.Function2<.A, .A, kotlin.Nothing> origin=LAMBDA diff --git a/compiler/testData/ir/irText/lambdas/nonLocalReturn.fir.txt b/compiler/testData/ir/irText/lambdas/nonLocalReturn.fir.txt index f573cadbea1..7b7c44fe85b 100644 --- a/compiler/testData/ir/irText/lambdas/nonLocalReturn.fir.txt +++ b/compiler/testData/ir/irText/lambdas/nonLocalReturn.fir.txt @@ -2,49 +2,49 @@ 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.Nothing origin=null - block: BLOCK type=IrErrorType origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit + block: BLOCK type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Nothing BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test0' + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Nothing 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=IrErrorType origin=LAMBDA + FUNCTION_REFERENCE 'local final fun (): kotlin.Nothing 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.Nothing origin=null - block: BLOCK type=IrErrorType origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit + block: BLOCK type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Nothing BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test1' + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Nothing 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=IrErrorType origin=LAMBDA + FUNCTION_REFERENCE 'local final fun (): kotlin.Nothing 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.Nothing origin=null - block: BLOCK type=IrErrorType origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit + block: BLOCK type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Nothing BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test2' + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Nothing 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=IrErrorType origin=LAMBDA + FUNCTION_REFERENCE 'local final fun (): kotlin.Nothing 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.Nothing origin=null - block: BLOCK type=IrErrorType origin=LAMBDA + block: BLOCK type=kotlin.Function0 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Nothing BLOCK_BODY CALL 'public final fun run (block: kotlin.Function0>): R of [inline] declared in kotlin' type=kotlin.Nothing origin=null - block: BLOCK type=IrErrorType origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit + block: BLOCK type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Nothing BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test3.' + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Nothing 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=IrErrorType origin=LAMBDA - FUNCTION_REFERENCE 'local final fun (): kotlin.Nothing declared in .test3' type=IrErrorType origin=LAMBDA + FUNCTION_REFERENCE 'local final fun (): kotlin.Nothing declared in .test3.' type=kotlin.Function0 origin=LAMBDA + FUNCTION_REFERENCE 'local final fun (): kotlin.Nothing 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.Unit origin=LAMBDA + action: BLOCK type=kotlin.Function1 origin=LAMBDA 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 +57,12 @@ 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.Unit origin=LAMBDA + 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.Unit origin=LAMBDA + action: BLOCK type=kotlin.Function1 origin=LAMBDA 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,5 +75,4 @@ 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.Unit origin=LAMBDA - + 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/stubs/builtinMap.fir.txt b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt index 8d05c20732f..3226507838f 100644 --- a/compiler/testData/ir/irText/stubs/builtinMap.fir.txt +++ b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt @@ -14,12 +14,11 @@ 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.Unit origin=LAMBDA + block: BLOCK type=kotlin.Function2.plus, V1 of .plus>, java.util.LinkedHashMap.plus, V1 of .plus>, kotlin.Unit> origin=LAMBDA 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.Unit origin=LAMBDA - + 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