From beb4cf3d997388225ab49ee3b8defbc389062bf7 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Mon, 31 Jan 2022 12:51:53 +0300 Subject: [PATCH] PSI2IR KT-51036 fix lambda return value generation --- .../FirBlackBoxCodegenTestGenerated.java | 6 ++ .../runners/ir/Fir2IrTextTestGenerated.java | 6 ++ .../kotlin/psi2ir/generators/BodyGenerator.kt | 13 +++- .../psi2ir/generators/FunctionGenerator.kt | 10 ++-- compiler/testData/codegen/box/unit/kt51036.kt | 14 +++++ .../expressions/badBreakContinue.ir.txt | 3 +- .../expressions/badBreakContinue.kt.txt | 2 +- .../ir/irText/expressions/kt51036.fir.ir.txt | 59 +++++++++++++++++++ .../ir/irText/expressions/kt51036.ir.txt | 59 +++++++++++++++++++ .../testData/ir/irText/expressions/kt51036.kt | 8 +++ .../codegen/BlackBoxCodegenTestGenerated.java | 6 ++ .../IrBlackBoxCodegenTestGenerated.java | 6 ++ .../test/runners/ir/IrTextTestGenerated.java | 6 ++ .../LightAnalysisModeTestGenerated.java | 5 ++ .../klib/KlibTextTestCaseGenerated.java | 5 ++ .../js/test/JsCodegenBoxTestGenerated.java | 6 ++ .../test/ir/IrJsCodegenBoxTestGenerated.java | 6 ++ .../IrCodegenBoxWasmTestGenerated.java | 5 ++ .../blackboxtest/ExternalTestGenerated.java | 6 ++ 19 files changed, 222 insertions(+), 9 deletions(-) create mode 100644 compiler/testData/codegen/box/unit/kt51036.kt create mode 100644 compiler/testData/ir/irText/expressions/kt51036.fir.ir.txt create mode 100644 compiler/testData/ir/irText/expressions/kt51036.ir.txt create mode 100644 compiler/testData/ir/irText/expressions/kt51036.kt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 8787a4f9fa1..df672f17c9f 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -44803,6 +44803,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/unit/kt4265.kt"); } + @Test + @TestMetadata("kt51036.kt") + public void testKt51036() throws Exception { + runTest("compiler/testData/codegen/box/unit/kt51036.kt"); + } + @Test @TestMetadata("nullableUnit.kt") public void testNullableUnit() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java index 5ba65444c02..623810d97b6 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java @@ -1676,6 +1676,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { runTest("compiler/testData/ir/irText/expressions/kt50028.kt"); } + @Test + @TestMetadata("kt51036.kt") + public void testKt51036() throws Exception { + runTest("compiler/testData/ir/irText/expressions/kt51036.kt"); + } + @Test @TestMetadata("lambdaInCAO.kt") public void testLambdaInCAO() throws Exception { diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BodyGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BodyGenerator.kt index cfc845c8889..a5fe89c5cab 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BodyGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BodyGenerator.kt @@ -34,10 +34,10 @@ import org.jetbrains.kotlin.psi.synthetics.findClassDescriptor import org.jetbrains.kotlin.psi2ir.intermediate.VariableLValue import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.bindingContextUtil.isUsedAsExpression -import org.jetbrains.kotlin.resolve.bindingContextUtil.isUsedAsResultOfLambda import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperClassOrAny import org.jetbrains.kotlin.types.KotlinType +import org.jetbrains.kotlin.types.typeUtil.isUnit class BodyGenerator( val scopeOwnerSymbol: IrSymbol, @@ -74,7 +74,7 @@ class BodyGenerator( fun generateExpressionBody(ktExpression: KtExpression): IrExpressionBody = context.irFactory.createExpressionBody(createStatementGenerator().generateExpression(ktExpression)) - fun generateLambdaBody(ktFun: KtFunctionLiteral): IrBody { + fun generateLambdaBody(ktFun: KtFunctionLiteral, lambdaDescriptor: SimpleFunctionDescriptor): IrBody { val statementGenerator = createStatementGenerator() val ktBody = ktFun.bodyExpression!! @@ -101,7 +101,14 @@ class BodyGenerator( val ktReturnedValue = ktBodyStatements.last() val irReturnedValue = statementGenerator.generateStatement(ktReturnedValue) irBlockBody.statements.add( - if (ktReturnedValue.isUsedAsResultOfLambda(context.bindingContext) && irReturnedValue is IrExpression) { + // We used to determine whether the last expression in a lambda is used as a return value with 'isUsedAsResultOfLambda', + // but it's in fact rather unreliable (see, for example, KT-51306). + // Instead, we just check whether lambda is expected to return a non-Unit value, + // and check that the last expression is not 'return' or 'throw'. + if (!lambdaDescriptor.returnType!!.isUnit() && + irReturnedValue is IrExpression && + irReturnedValue !is IrReturn && irReturnedValue !is IrThrow + ) { generateReturnExpression(irReturnedValue.startOffset, irReturnedValue.endOffset, irReturnedValue) } else { irReturnedValue diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/FunctionGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/FunctionGenerator.kt index efe15ef3711..f45d20a94b6 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/FunctionGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/FunctionGenerator.kt @@ -57,16 +57,18 @@ class FunctionGenerator(declarationGenerator: DeclarationGenerator) : Declaratio ktFunction.bodyExpression?.let { generateFunctionBody(it) } } - fun generateLambdaFunctionDeclaration(ktFunction: KtFunctionLiteral): IrSimpleFunction = - declareSimpleFunction( + fun generateLambdaFunctionDeclaration(ktFunction: KtFunctionLiteral): IrSimpleFunction { + val lambdaDescriptor = getOrFail(BindingContext.FUNCTION, ktFunction) + return declareSimpleFunction( ktFunction, null, emptyList(), IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA, - getOrFail(BindingContext.FUNCTION, ktFunction) + lambdaDescriptor ) { - generateLambdaBody(ktFunction) + generateLambdaBody(ktFunction, lambdaDescriptor) } + } fun generateFakeOverrideFunction(functionDescriptor: FunctionDescriptor, ktElement: KtPureElement): IrSimpleFunction? = functionDescriptor.takeIf { it.visibility != DescriptorVisibilities.INVISIBLE_FAKE } diff --git a/compiler/testData/codegen/box/unit/kt51036.kt b/compiler/testData/codegen/box/unit/kt51036.kt new file mode 100644 index 00000000000..f5c75a3ab9e --- /dev/null +++ b/compiler/testData/codegen/box/unit/kt51036.kt @@ -0,0 +1,14 @@ +// WITH_STDLIB +// IGNORE_BACKEND: WASM +// ^ Unresolved reference: synchronized + +fun box(): String { + A().close() + return "OK" +} + +class A { + companion object; + operator fun String.invoke() = Unit + fun close() = synchronized(this) { "abc" }() +} diff --git a/compiler/testData/ir/irText/expressions/badBreakContinue.ir.txt b/compiler/testData/ir/irText/expressions/badBreakContinue.ir.txt index 24e158ff0c1..b6ceef6f4d0 100644 --- a/compiler/testData/ir/irText/expressions/badBreakContinue.ir.txt +++ b/compiler/testData/ir/irText/expressions/badBreakContinue.ir.txt @@ -20,7 +20,8 @@ FILE fqName: fileName:/badBreakContinue.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Nothing BLOCK_BODY ERROR_EXPR 'Loop not found for break expression: break@L1' type=kotlin.Nothing - ERROR_EXPR 'Loop not found for continue expression: continue@L1' type=kotlin.Nothing + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Nothing declared in .test3' + ERROR_EXPR 'Loop not found for continue expression: continue@L1' type=kotlin.Nothing 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/badBreakContinue.kt.txt b/compiler/testData/ir/irText/expressions/badBreakContinue.kt.txt index 639020d3918..59c496f8867 100644 --- a/compiler/testData/ir/irText/expressions/badBreakContinue.kt.txt +++ b/compiler/testData/ir/irText/expressions/badBreakContinue.kt.txt @@ -14,7 +14,7 @@ fun test3() { L1@ while (true) { // BLOCK val lambda: Function0 = local fun (): Nothing { error("") /* ErrorExpression */ - error("") /* ErrorExpression */ + return error("") /* ErrorExpression */ } } diff --git a/compiler/testData/ir/irText/expressions/kt51036.fir.ir.txt b/compiler/testData/ir/irText/expressions/kt51036.fir.ir.txt new file mode 100644 index 00000000000..a34f8daaf88 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt51036.fir.ir.txt @@ -0,0 +1,59 @@ +FILE fqName: fileName:/kt51036.kt + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.Companion + CONSTRUCTOR visibility:private <> () returnType:.A.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:invoke visibility:public modality:FINAL <> ($this:.A, $receiver:kotlin.String) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.A + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun invoke (): kotlin.Unit [operator] declared in .A' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUN name:close visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun close (): kotlin.Unit declared in .A' + CALL 'public final fun invoke (): kotlin.Unit [operator] declared in .A' type=kotlin.Unit origin=null + $this: GET_VAR ': .A declared in .A.close' type=.A origin=null + $receiver: CALL 'public final fun synchronized (lock: kotlin.Any, block: kotlin.Function0): R of kotlin.StandardKt.synchronized [inline] declared in kotlin.StandardKt' type=kotlin.String origin=null + : kotlin.String + lock: GET_VAR ': .A declared in .A.close' type=.A origin=null + block: FUN_EXPR type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .A.close' + CONST String type=kotlin.String value="Abc" + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/kt51036.ir.txt b/compiler/testData/ir/irText/expressions/kt51036.ir.txt new file mode 100644 index 00000000000..0e04f54425e --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt51036.ir.txt @@ -0,0 +1,59 @@ +FILE fqName: fileName:/kt51036.kt + CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' + CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.Companion + CONSTRUCTOR visibility:private <> () returnType:.A.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:invoke visibility:public modality:FINAL <> ($this:.A, $receiver:kotlin.String) returnType:kotlin.Unit [operator] + $this: VALUE_PARAMETER name: type:.A + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun invoke (): kotlin.Unit [operator] declared in .A' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + FUN name:close visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun close (): kotlin.Unit declared in .A' + CALL 'public final fun invoke (): kotlin.Unit [operator] declared in .A' type=kotlin.Unit origin=INVOKE + $this: GET_VAR ': .A declared in .A.close' type=.A origin=null + $receiver: CALL 'public final fun synchronized (lock: kotlin.Any, block: kotlin.Function0): R of kotlin.StandardKt.synchronized [inline] declared in kotlin.StandardKt' type=kotlin.String origin=null + : kotlin.String + lock: GET_VAR ': .A declared in .A.close' type=.A origin=null + block: FUN_EXPR type=kotlin.Function0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .A.close' + CONST String type=kotlin.String value="Abc" + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/kt51036.kt b/compiler/testData/ir/irText/expressions/kt51036.kt new file mode 100644 index 00000000000..12467081bf6 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/kt51036.kt @@ -0,0 +1,8 @@ +// WITH_STDLIB +// SKIP_KT_DUMP + +class A { + companion object; + operator fun String.invoke() = Unit + fun close() = synchronized(this) { "Abc" }() +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 4fc25bb1c85..4a72630211b 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -44341,6 +44341,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/unit/kt4265.kt"); } + @Test + @TestMetadata("kt51036.kt") + public void testKt51036() throws Exception { + runTest("compiler/testData/codegen/box/unit/kt51036.kt"); + } + @Test @TestMetadata("nullableUnit.kt") public void testNullableUnit() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 0e16bae6f74..7357b3ad63b 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -44803,6 +44803,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/unit/kt4265.kt"); } + @Test + @TestMetadata("kt51036.kt") + public void testKt51036() throws Exception { + runTest("compiler/testData/codegen/box/unit/kt51036.kt"); + } + @Test @TestMetadata("nullableUnit.kt") public void testNullableUnit() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java index e2a8fb81333..eb5e618c090 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java @@ -1676,6 +1676,12 @@ public class IrTextTestGenerated extends AbstractIrTextTest { runTest("compiler/testData/ir/irText/expressions/kt50028.kt"); } + @Test + @TestMetadata("kt51036.kt") + public void testKt51036() throws Exception { + runTest("compiler/testData/ir/irText/expressions/kt51036.kt"); + } + @Test @TestMetadata("lambdaInCAO.kt") public void testLambdaInCAO() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index c3e6c196551..93f05176ba4 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -35951,6 +35951,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/unit/kt4265.kt"); } + @TestMetadata("kt51036.kt") + public void testKt51036() throws Exception { + runTest("compiler/testData/codegen/box/unit/kt51036.kt"); + } + @TestMetadata("nullableUnit.kt") public void testNullableUnit() throws Exception { runTest("compiler/testData/codegen/box/unit/nullableUnit.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibTextTestCaseGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibTextTestCaseGenerated.java index 95e21790c8a..1b08f11b9ea 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibTextTestCaseGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibTextTestCaseGenerated.java @@ -1257,6 +1257,11 @@ public class KlibTextTestCaseGenerated extends AbstractKlibTextTestCase { runTest("compiler/testData/ir/irText/expressions/kt50028.kt"); } + @TestMetadata("kt51036.kt") + public void testKt51036() throws Exception { + runTest("compiler/testData/ir/irText/expressions/kt51036.kt"); + } + @TestMetadata("lambdaInCAO.kt") public void testLambdaInCAO() throws Exception { runTest("compiler/testData/ir/irText/expressions/lambdaInCAO.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java index 73a3ef131bf..fe319464e74 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java @@ -32079,6 +32079,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/unit/kt4265.kt"); } + @Test + @TestMetadata("kt51036.kt") + public void testKt51036() throws Exception { + runTest("compiler/testData/codegen/box/unit/kt51036.kt"); + } + @Test @TestMetadata("nullableUnit.kt") public void testNullableUnit() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java index 2ea5347d9f7..85efa39e0a0 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java @@ -32181,6 +32181,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/unit/kt4265.kt"); } + @Test + @TestMetadata("kt51036.kt") + public void testKt51036() throws Exception { + runTest("compiler/testData/codegen/box/unit/kt51036.kt"); + } + @Test @TestMetadata("nullableUnit.kt") public void testNullableUnit() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index 0376cb23cf1..5beee6cd3d4 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -26923,6 +26923,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/unit/kt4265.kt"); } + @TestMetadata("kt51036.kt") + public void testKt51036() throws Exception { + runTest("compiler/testData/codegen/box/unit/kt51036.kt"); + } + @TestMetadata("nullableUnit.kt") public void testNullableUnit() throws Exception { runTest("compiler/testData/codegen/box/unit/nullableUnit.kt"); diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/ExternalTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/ExternalTestGenerated.java index d8b87bb8d68..82c7fbfbd9f 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/ExternalTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/ExternalTestGenerated.java @@ -34432,6 +34432,12 @@ public class ExternalTestGenerated extends AbstractExternalNativeBlackBoxTest { runTest("compiler/testData/codegen/box/unit/kt4265.kt"); } + @Test + @TestMetadata("kt51036.kt") + public void testKt51036() throws Exception { + runTest("compiler/testData/codegen/box/unit/kt51036.kt"); + } + @Test @TestMetadata("nullableUnit.kt") public void testNullableUnit() throws Exception {