From fe02c2bab318878855859e4bd7024c522d6d22d9 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Mon, 20 Apr 2020 11:33:47 +0300 Subject: [PATCH] FIR: return Unit from empty lambda --- .../testData/resolve/arguments/lambda.txt | 34 ++++++------- .../resolve/arguments/lambdaInLambda.txt | 2 +- .../callResolution/invokeAmbiguity.txt | 2 +- .../analysis-tests/testData/resolve/cast.txt | 2 +- .../testData/resolve/expresssions/lambda.kt | 2 + .../testData/resolve/expresssions/lambda.txt | 4 ++ ...exLambdaWithTypeVariableAsExpectedType.txt | 2 +- .../resolve/samConstructors/runnable.txt | 2 +- .../problems/invokePriority.txt | 6 +-- .../converter/ExpressionsConverter.kt | 11 ++++- .../kotlin/fir/builder/RawFirBuilder.kt | 13 ++--- .../declarations/contractDescription.txt | 6 +-- .../rawBuilder/expressions/lambda.txt | 2 +- .../lambdaInDataClassDefaultParameter.fir.txt | 3 +- .../declarations/parameters/lambdas.fir.txt | 3 +- .../arrayAsVarargAfterSamArgument_fi.fir.txt | 30 ++++++++---- .../samConversionInVarargs.fir.txt | 12 +++-- .../ir/irText/expressions/lambdaInCAO.fir.txt | 12 +++-- .../sam/arrayAsVarargAfterSamArgument.fir.txt | 48 ++++++++++++------- .../sam/genericSamProjectedOut.fir.txt | 9 ++-- .../expressions/sam/samConstructors.fir.txt | 3 +- .../ir/irText/lambdas/justLambda.fir.txt | 26 ---------- .../testData/ir/irText/lambdas/justLambda.kt | 1 + 23 files changed, 132 insertions(+), 103 deletions(-) delete mode 100644 compiler/testData/ir/irText/lambdas/justLambda.fir.txt diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/lambda.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/lambda.txt index eb96253cdb9..191b959464d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/lambda.txt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/lambda.txt @@ -7,70 +7,70 @@ FILE: lambda.kt } public final fun test(): R|kotlin/Unit| { R|/foo|( = foo@fun (): R|kotlin/Unit| { - Unit + ^@foo Unit } ) R|/foo|( = foo@fun (): R|kotlin/Unit| { - Unit + ^@foo Unit } ) R|/foo|(foo@fun (): R|kotlin/Unit| { - Unit + ^@foo Unit } ) #(Int(1), = foo@fun (): R|kotlin/Unit| { - Unit + ^@foo Unit } ) #(f = foo@fun (): R|kotlin/Unit| { - Unit + ^@foo Unit } , = foo@fun (): R|kotlin/Unit| { - Unit + ^@foo Unit } ) R|/bar|(Int(1), = bar@fun (): R|kotlin/Unit| { - Unit + ^@bar Unit } ) R|/bar|(x = Int(1), = bar@fun (): R|kotlin/Unit| { - Unit + ^@bar Unit } ) R|/bar|(Int(1), bar@fun (): R|kotlin/Unit| { - Unit + ^@bar Unit } ) R|/bar|(x = Int(1), f = bar@fun (): R|kotlin/Unit| { - Unit + ^@bar Unit } ) #( = bar@fun (): R|kotlin/Unit| { - Unit + ^@bar Unit } ) #(bar@fun (): R|kotlin/Unit| { - Unit + ^@bar Unit } ) R|/baz|(other = Boolean(false), f = baz@fun (): R|kotlin/Unit| { - Unit + ^@baz Unit } ) R|/baz|(baz@fun (): R|kotlin/Unit| { - Unit + ^@baz Unit } , Boolean(false)) #( = baz@fun (): R|kotlin/Unit| { - Unit + ^@baz Unit } ) #( = baz@fun (): R|kotlin/Unit| { - Unit + ^@baz Unit } ) #(other = Boolean(false), = baz@fun (): R|kotlin/Unit| { - Unit + ^@baz Unit } ) } diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda.txt index 7fbfedd97e2..02385227711 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda.txt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda.txt @@ -28,7 +28,7 @@ FILE: lambdaInLambda.kt this@R|special/anonymous|.R|/insert|(R|/KDocTemplate.KDocTemplate|(), = insert@fun R|KDocTemplate|.(): R|kotlin/Unit| { this@R|special/anonymous|.R|/KDocTemplate.definition|( = definition@fun R|StringBuilder|.(): R|kotlin/Unit| { ^ R|/ordinal|?.R|kotlin/let|( = let@fun (it: R|kotlin/Int|): R|kotlin/Unit| { - Unit + ^@let Unit } ) } diff --git a/compiler/fir/analysis-tests/testData/resolve/callResolution/invokeAmbiguity.txt b/compiler/fir/analysis-tests/testData/resolve/callResolution/invokeAmbiguity.txt index 9d30b415b89..86fa6172cae 100644 --- a/compiler/fir/analysis-tests/testData/resolve/callResolution/invokeAmbiguity.txt +++ b/compiler/fir/analysis-tests/testData/resolve/callResolution/invokeAmbiguity.txt @@ -41,7 +41,7 @@ FILE: invokeAmbiguity.kt } public final fun box(d: R|D|): R|kotlin/Unit| { R|/d|.R|/attr|.R|/B.invoke|( = attr@fun (): R|kotlin/Unit| { - Unit + ^@attr Unit } ).R|kotlin/CharSequence.length| } diff --git a/compiler/fir/analysis-tests/testData/resolve/cast.txt b/compiler/fir/analysis-tests/testData/resolve/cast.txt index 16ccfb6f2bb..ca2d385e8ef 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cast.txt +++ b/compiler/fir/analysis-tests/testData/resolve/cast.txt @@ -9,7 +9,7 @@ FILE: cast.kt public get(): R|() -> kotlin/Any| public final val g: R|() -> kotlin/Unit| = fun (): R|kotlin/Unit| { - Unit + ^ Unit } public get(): R|() -> kotlin/Unit| diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/lambda.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/lambda.kt index ce2a8952974..44ec0b78536 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/lambda.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/lambda.kt @@ -13,5 +13,7 @@ fun main() { val f = { "OK" } val ss = f.invoke() + + val empty: () -> Unit = { } } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/lambda.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/lambda.txt index a3781ec6335..b76334a2b5a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/lambda.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/lambda.txt @@ -33,4 +33,8 @@ FILE: lambda.kt } lval ss: R|kotlin/String| = R|/f|.R|FakeOverride|() + lval empty: R|() -> kotlin/Unit| = fun (): R|kotlin/Unit| { + ^ Unit + } + } diff --git a/compiler/fir/analysis-tests/testData/resolve/problems/complexLambdaWithTypeVariableAsExpectedType.txt b/compiler/fir/analysis-tests/testData/resolve/problems/complexLambdaWithTypeVariableAsExpectedType.txt index 8620b23cc0f..c87cebf5b11 100644 --- a/compiler/fir/analysis-tests/testData/resolve/problems/complexLambdaWithTypeVariableAsExpectedType.txt +++ b/compiler/fir/analysis-tests/testData/resolve/problems/complexLambdaWithTypeVariableAsExpectedType.txt @@ -10,7 +10,7 @@ FILE: complexLambdaWithTypeVariableAsExpectedType.kt ^ R|/it|.R|kotlin/Int.inv|() } ), R|/id| kotlin/Unit|>( = id@fun (it: R|kotlin/Int|): R|kotlin/Unit| { - Unit + ^@id Unit } )) } diff --git a/compiler/fir/analysis-tests/testData/resolve/samConstructors/runnable.txt b/compiler/fir/analysis-tests/testData/resolve/samConstructors/runnable.txt index b67de7af5bb..6115a67caa5 100644 --- a/compiler/fir/analysis-tests/testData/resolve/samConstructors/runnable.txt +++ b/compiler/fir/analysis-tests/testData/resolve/samConstructors/runnable.txt @@ -3,7 +3,7 @@ FILE: runnable.kt } public final fun main(): R|kotlin/Unit| { R|/foo|(R|java/lang/Runnable|( = Runnable@fun (): R|kotlin/Unit| { - Unit + ^@Runnable Unit } )) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/invokePriority.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/invokePriority.txt index e21660fc6e6..b43ae45e48c 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/invokePriority.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/invokePriority.txt @@ -6,7 +6,7 @@ FILE: invokePriority.kt public final fun bar(): R|kotlin/Unit| { lval foo: R|kotlin/String.() -> kotlin/Unit| = fun R|kotlin/String|.(): R|kotlin/Unit| { - Unit + ^ Unit } local final fun R|kotlin/String|.foo(): R|kotlin/Unit| { @@ -26,7 +26,7 @@ FILE: invokePriority.kt } public final val foo: R|kotlin/String.() -> kotlin/Unit| = fun R|kotlin/String|.(): R|kotlin/Unit| { - Unit + ^ Unit } public get(): R|kotlin/String.() -> kotlin/Unit| @@ -65,7 +65,7 @@ FILE: invokePriority.kt } public final val f: R|() -> kotlin/Unit| = fun (): R|kotlin/Unit| { - Unit + ^ Unit } public get(): R|() -> kotlin/Unit| diff --git a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt index 8f9f62d02fd..24ba62bde5c 100644 --- a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt +++ b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt @@ -130,8 +130,9 @@ class ExpressionsConverter( val labelName = lambdaExpression.getLabelName() ?: context.firFunctionCalls.lastOrNull()?.calleeReference?.name?.asString() val target = FirFunctionTarget(labelName = labelName, isLambda = true) + val expressionSource = lambdaExpression.toFirSourceElement() return buildAnonymousFunction { - source = lambdaExpression.toFirSourceElement() + source = expressionSource session = baseSession returnTypeRef = implicitType receiverTypeRef = implicitType @@ -171,7 +172,13 @@ class ExpressionsConverter( body = if (block != null) { declarationsConverter.convertBlockExpressionWithoutBuilding(block!!).apply { if (statements.isEmpty()) { - statements.add(buildUnitExpression()) + statements.add( + buildReturnExpression { + source = expressionSource + this.target = target + result = buildUnitExpression { source = expressionSource } + } + ) } if (destructuringBlock is FirBlock) { for ((index, statement) in destructuringBlock.statements.withIndex()) { diff --git a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt index ecfc5daf0ac..1255c5e1380 100644 --- a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt +++ b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt @@ -7,15 +7,12 @@ package org.jetbrains.kotlin.fir.builder import com.intellij.psi.PsiElement import com.intellij.psi.tree.IElementType -import kotlinx.collections.immutable.PersistentList -import kotlinx.collections.immutable.mutate import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.descriptors.Visibility import org.jetbrains.kotlin.fir.* import org.jetbrains.kotlin.fir.contracts.FirContractDescription -import org.jetbrains.kotlin.fir.contracts.builder.buildRawContractDescription import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.declarations.builder.* import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl @@ -28,7 +25,6 @@ import org.jetbrains.kotlin.fir.expressions.* import org.jetbrains.kotlin.fir.expressions.builder.* import org.jetbrains.kotlin.fir.expressions.impl.FirModifiableQualifiedAccess import org.jetbrains.kotlin.fir.expressions.impl.FirSingleExpressionBlock -import org.jetbrains.kotlin.fir.expressions.impl.FirStubStatement import org.jetbrains.kotlin.fir.references.FirNamedReference import org.jetbrains.kotlin.fir.references.builder.* import org.jetbrains.kotlin.fir.scopes.FirScopeProvider @@ -45,7 +41,6 @@ import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType import org.jetbrains.kotlin.psi.psiUtil.hasActualModifier import org.jetbrains.kotlin.psi.psiUtil.hasExpectModifier -import org.jetbrains.kotlin.psi.psiUtil.isContractDescriptionCallPsiCheck import org.jetbrains.kotlin.types.Variance import org.jetbrains.kotlin.types.expressions.OperatorConventions import org.jetbrains.kotlin.util.OperatorNameConventions @@ -932,7 +927,13 @@ class RawFirBuilder( } else { configureBlockWithoutBuilding(ktBody).apply { if (statements.isEmpty()) { - statements.add(buildUnitExpression { source = expressionSource }) + statements.add( + buildReturnExpression { + source = expressionSource + this.target = target + result = buildUnitExpression { source = expressionSource } + } + ) } if (destructuringBlock is FirBlock) { for ((index, statement) in destructuringBlock.statements.withIndex()) { diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contractDescription.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contractDescription.txt index c21501c640b..d1b521cdaaf 100644 --- a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contractDescription.txt +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contractDescription.txt @@ -59,21 +59,21 @@ FILE: contractDescription.kt } public? final? fun test_6(): R|kotlin/Unit| { aaa#.bbb#.ccc#.contract#( = contract@fun .(): { - Unit + ^@contract Unit } ) test_6#() } public? final? fun test_7(): R|kotlin/Unit| { contracts#.contract#( = contract@fun .(): { - Unit + ^@contract Unit } ) test_7#() } public? final? fun test_8(): R|kotlin/Unit| { aaa#.kotlin#.contracts#.contract#( = contract@fun .(): { - Unit + ^@contract Unit } ) test_8#() diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions/lambda.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions/lambda.txt index 49f563b8b30..da65537ecce 100644 --- a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions/lambda.txt +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions/lambda.txt @@ -67,7 +67,7 @@ FILE: lambda.kt ) } public? final? val simple: = fun .(): { - Unit + ^ Unit } public? get(): diff --git a/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt b/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt index fe04021f2a8..3c0245b1ba6 100644 --- a/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt +++ b/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt @@ -9,7 +9,8 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt $receiver: VALUE_PARAMETER name: type:.A VALUE_PARAMETER name:it index:0 type:kotlin.String BLOCK_BODY - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + RETURN type=kotlin.Nothing from='local final fun (it: kotlin.String): kotlin.Unit declared in .A.' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit 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 8c6a7310181..45c592a14f5 100644 --- a/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/lambdas.fir.txt @@ -37,7 +37,8 @@ FILE fqName: fileName:/lambdas.kt 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 + RETURN type=kotlin.Nothing from='local final fun (i: kotlin.Int, j: kotlin.Int): 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 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function2 correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.fir.txt b/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.fir.txt index b9c915aaea2..f531ceb2eb5 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.fir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/arrayAsVarargAfterSamArgument_fi.fir.txt @@ -35,14 +35,16 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument_fi.kt r: FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit s: VARARG type=kotlin.Array varargElementType=kotlin.String GET_VAR 's: kotlin.String declared in .test' type=kotlin.String origin=null CALL 'public final fun foo1 (r: .IRunnable, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null r: FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit s: VARARG type=kotlin.Array varargElementType=kotlin.String SPREAD_ELEMENT GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null @@ -68,22 +70,26 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument_fi.kt r1: FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit r2: FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit s: VARARG type=kotlin.Array varargElementType=kotlin.String GET_VAR 's: kotlin.String declared in .test' type=kotlin.String origin=null CALL 'public final fun foo2 (r1: .IRunnable, r2: .IRunnable, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null r1: FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit r2: FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit s: VARARG type=kotlin.Array varargElementType=kotlin.String SPREAD_ELEMENT GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null @@ -92,7 +98,8 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument_fi.kt r2: FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit s: VARARG type=kotlin.Array varargElementType=kotlin.String GET_VAR 's: kotlin.String declared in .test' type=kotlin.String origin=null CALL 'public final fun foo2 (r1: .IRunnable, r2: .IRunnable, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -100,7 +107,8 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument_fi.kt r2: FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit s: VARARG type=kotlin.Array varargElementType=kotlin.String SPREAD_ELEMENT GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null @@ -109,7 +117,8 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument_fi.kt r2: FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit s: VARARG type=kotlin.Array varargElementType=kotlin.String GET_VAR 's: kotlin.String declared in .test' type=kotlin.String origin=null CALL 'public final fun foo2 (r1: .IRunnable, r2: .IRunnable, vararg s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -117,7 +126,8 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument_fi.kt r2: FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit s: VARARG type=kotlin.Array varargElementType=kotlin.String SPREAD_ELEMENT GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.txt index 3be9a09fc99..71381543462 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.txt @@ -28,7 +28,8 @@ FILE fqName: fileName:/samConversionInVarargs.kt 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 - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): kotlin.Unit declared in .testLambda' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit FUN name:testSeveralLambdas visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun useVararg (vararg foos: .IFoo): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -37,17 +38,20 @@ FILE fqName: fileName:/samConversionInVarargs.kt 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 - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): kotlin.Unit declared in .testSeveralLambdas' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit FUN_EXPR 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 - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): kotlin.Unit declared in .testSeveralLambdas' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit FUN_EXPR 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 - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + RETURN type=kotlin.Nothing from='local final fun (it: kotlin.Int): kotlin.Unit declared in .testSeveralLambdas' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit FUN name:withVarargOfInt visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.String VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt index cbb6e0477b5..077e9d8cd54 100644 --- a/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt +++ b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt @@ -22,7 +22,8 @@ FILE fqName: fileName:/lambdaInCAO.kt lambda: FUN_EXPR 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 + 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 FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY @@ -33,7 +34,8 @@ FILE fqName: fileName:/lambdaInCAO.kt FUN_EXPR 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 + 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 CALL 'public final fun set (index: kotlin.Function0, value: kotlin.Int): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR 'val tmp_0: kotlin.Any [val] declared in .test2' type=kotlin.Any origin=null index: GET_VAR 'val tmp_1: kotlin.Function0 [val] declared in .test2' type=kotlin.Function0 origin=null @@ -51,13 +53,15 @@ FILE fqName: fileName:/lambdaInCAO.kt index: FUN_EXPR 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 + 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 CALL 'public final fun set (index: kotlin.Function0, value: kotlin.Int): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR 'a: kotlin.Any declared in .test3' type=kotlin.Any origin=null index: FUN_EXPR 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 + 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 value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_2: kotlin.Int [val] declared in .test3' type=kotlin.Int origin=null GET_VAR 'val tmp_2: kotlin.Int [val] declared in .test3' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt index f6ec6db2aa3..961a18a0013 100644 --- a/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt @@ -8,13 +8,15 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null CALL 'public open fun foo1 (r: java.lang.Runnable?, vararg strs: kotlin.String?): kotlin.String? declared in .Test' type=kotlin.String? origin=null r: FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? SPREAD_ELEMENT GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null @@ -48,14 +50,16 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null VAR name:i2 type:.Test [val] CONSTRUCTOR_CALL 'public constructor (r: java.lang.Runnable?, vararg strs: kotlin.String?) declared in .Test' type=.Test origin=null r: FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? SPREAD_ELEMENT GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null @@ -64,11 +68,13 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null VAR name:i4 type:.Test [val] CONSTRUCTOR_CALL 'public constructor (r1: java.lang.Runnable?, r2: java.lang.Runnable?, vararg strs: kotlin.String?) declared in .Test' type=.Test origin=null @@ -76,7 +82,8 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt r2: FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? CONST String type=kotlin.String value="" VAR name:i5 type:.Test [val] @@ -84,11 +91,13 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt r1: FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit r2: FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? SPREAD_ELEMENT GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null @@ -98,7 +107,8 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt r2: FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? SPREAD_ELEMENT GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null @@ -106,33 +116,39 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null ERROR_CALL 'Unresolved reference: #' type=IrErrorType GET_VAR 'r: java.lang.Runnable declared in .test' type=java.lang.Runnable origin=null FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit CONST String type=kotlin.String value="" ERROR_CALL 'Unresolved reference: #' type=IrErrorType FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null ERROR_CALL 'Unresolved reference: #' type=IrErrorType GET_VAR 'r: java.lang.Runnable declared in .test' type=java.lang.Runnable origin=null FUN_EXPR 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 + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.txt b/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.txt index bd482f313ff..26fe88043d3 100644 --- a/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/genericSamProjectedOut.fir.txt @@ -8,18 +8,21 @@ FILE fqName: fileName:/genericSamProjectedOut.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.String?) returnType:kotlin.Unit VALUE_PARAMETER name:it index:0 type:kotlin.String? BLOCK_BODY - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + RETURN type=kotlin.Nothing from='local final fun (it: kotlin.String?): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit CALL 'public open fun plus (hello: example.Hello?): kotlin.Unit [operator] declared in example.SomeJavaClass' type=kotlin.Unit origin=PLUS $this: GET_VAR 'a: example.SomeJavaClass declared in .test' type=example.SomeJavaClass origin=null hello: FUN_EXPR type=kotlin.Function1 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.String?) returnType:kotlin.Unit VALUE_PARAMETER name:it index:0 type:kotlin.String? BLOCK_BODY - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + RETURN type=kotlin.Nothing from='local final fun (it: kotlin.String?): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit CALL 'public open fun get (hello: example.Hello?): kotlin.Unit [operator] declared in example.SomeJavaClass' type=kotlin.Unit origin=null $this: GET_VAR 'a: example.SomeJavaClass declared in .test' type=example.SomeJavaClass origin=null hello: FUN_EXPR type=kotlin.Function1 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.String?) returnType:kotlin.Unit VALUE_PARAMETER name:it index:0 type:kotlin.String? BLOCK_BODY - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + RETURN type=kotlin.Nothing from='local final fun (it: kotlin.String?): kotlin.Unit declared in .test' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt index 3d23852d4f0..3a62b097159 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConstructors.fir.txt @@ -6,7 +6,8 @@ FILE fqName: fileName:/samConstructors.kt block: FUN_EXPR 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 + 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 FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:java.lang.Runnable VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY diff --git a/compiler/testData/ir/irText/lambdas/justLambda.fir.txt b/compiler/testData/ir/irText/lambdas/justLambda.fir.txt deleted file mode 100644 index e9ee1d38fef..00000000000 --- a/compiler/testData/ir/irText/lambdas/justLambda.fir.txt +++ /dev/null @@ -1,26 +0,0 @@ -FILE fqName: fileName:/justLambda.kt - PROPERTY name:test1 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function0 visibility:private [final,static] - EXPRESSION_BODY - FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .test1' - CONST Int type=kotlin.Int value=42 - 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 (): kotlin.Function0 declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function0 visibility:private [final,static]' type=kotlin.Function0 origin=null - PROPERTY name:test2 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function0 visibility:private [final,static] - EXPRESSION_BODY - FUN_EXPR 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 - 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 (): kotlin.Function0 declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Function0 visibility:private [final,static]' type=kotlin.Function0 origin=null diff --git a/compiler/testData/ir/irText/lambdas/justLambda.kt b/compiler/testData/ir/irText/lambdas/justLambda.kt index 3fb4136b231..274aabf0789 100644 --- a/compiler/testData/ir/irText/lambdas/justLambda.kt +++ b/compiler/testData/ir/irText/lambdas/justLambda.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL val test1 = { 42 } val test2 = { } \ No newline at end of file