Do not box function argument if it is used in EXACTLY_ONCE lambda

Since we cannot change type of parameter, we cannot replace it with
box type.
 #KT-29510 Fixed
 #KT-29614 Fixed
 #KT-29385 Fixed
This commit is contained in:
Ilmir Usmanov
2019-09-25 22:55:48 +03:00
parent c5ba19451f
commit 08794d17a0
15 changed files with 254 additions and 16 deletions
@@ -3780,6 +3780,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true);
}
@TestMetadata("constructorArgument.kt")
public void testConstructorArgument() throws Exception {
runTest("compiler/testData/codegen/box/contracts/constructorArgument.kt");
}
@TestMetadata("exactlyOnceNotInline.kt")
public void testExactlyOnceNotInline() throws Exception {
runTest("compiler/testData/codegen/box/contracts/exactlyOnceNotInline.kt");
@@ -44,6 +44,11 @@ public class IrJsInlineContractsTestsGenerated extends AbstractIrJsInlineContrac
runTest("compiler/testData/codegen/boxInline/contracts/complexInitializerWithStackTransformation.kt");
}
@TestMetadata("crossinlineCallableReference.kt")
public void testCrossinlineCallableReference() throws Exception {
runTest("compiler/testData/codegen/boxInline/contracts/crossinlineCallableReference.kt");
}
@TestMetadata("definiteLongValInitialization.kt")
public void testDefiniteLongValInitialization() throws Exception {
runTest("compiler/testData/codegen/boxInline/contracts/definiteLongValInitialization.kt");
@@ -69,6 +74,11 @@ public class IrJsInlineContractsTestsGenerated extends AbstractIrJsInlineContrac
runTest("compiler/testData/codegen/boxInline/contracts/exactlyOnceCrossinline.kt");
}
@TestMetadata("exactlyOnceCrossinline2.kt")
public void testExactlyOnceCrossinline2() throws Exception {
runTest("compiler/testData/codegen/boxInline/contracts/exactlyOnceCrossinline2.kt");
}
@TestMetadata("exactlyOnceNoinline.kt")
public void testExactlyOnceNoinline() throws Exception {
runTest("compiler/testData/codegen/boxInline/contracts/exactlyOnceNoinline.kt");
@@ -3790,6 +3790,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
}
@TestMetadata("constructorArgument.kt")
public void testConstructorArgument() throws Exception {
runTest("compiler/testData/codegen/box/contracts/constructorArgument.kt");
}
@TestMetadata("exactlyOnceNotInline.kt")
public void testExactlyOnceNotInline() throws Exception {
runTest("compiler/testData/codegen/box/contracts/exactlyOnceNotInline.kt");
@@ -44,6 +44,11 @@ public class JsInlineContractsTestsGenerated extends AbstractJsInlineContractsTe
runTest("compiler/testData/codegen/boxInline/contracts/complexInitializerWithStackTransformation.kt");
}
@TestMetadata("crossinlineCallableReference.kt")
public void testCrossinlineCallableReference() throws Exception {
runTest("compiler/testData/codegen/boxInline/contracts/crossinlineCallableReference.kt");
}
@TestMetadata("definiteLongValInitialization.kt")
public void testDefiniteLongValInitialization() throws Exception {
runTest("compiler/testData/codegen/boxInline/contracts/definiteLongValInitialization.kt");
@@ -69,6 +74,11 @@ public class JsInlineContractsTestsGenerated extends AbstractJsInlineContractsTe
runTest("compiler/testData/codegen/boxInline/contracts/exactlyOnceCrossinline.kt");
}
@TestMetadata("exactlyOnceCrossinline2.kt")
public void testExactlyOnceCrossinline2() throws Exception {
runTest("compiler/testData/codegen/boxInline/contracts/exactlyOnceCrossinline2.kt");
}
@TestMetadata("exactlyOnceNoinline.kt")
public void testExactlyOnceNoinline() throws Exception {
runTest("compiler/testData/codegen/boxInline/contracts/exactlyOnceNoinline.kt");