IR: keep capture sets the same when copying objects for tailrec funs

tailrec f(x: () -> T = { y }, y: T = ...) = f()

-- at the call we know that in `x` the observed value of `y` is `null`,
but the constructor should still have a single parameter.
This commit is contained in:
pyos
2021-09-21 12:16:51 +02:00
committed by Mikhael Bogdanov
parent a4d1358e57
commit cb505d1101
10 changed files with 67 additions and 17 deletions
@@ -9362,6 +9362,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
runTest("compiler/testData/codegen/box/defaultArguments/useNextParamInLambda.kt");
}
@TestMetadata("useNextParamInLambdaTailrec.kt")
public void testUseNextParamInLambdaTailrec() throws Exception {
runTest("compiler/testData/codegen/box/defaultArguments/useNextParamInLambdaTailrec.kt");
}
@TestMetadata("useThisInLambda.kt")
public void testUseThisInLambda() throws Exception {
runTest("compiler/testData/codegen/box/defaultArguments/useThisInLambda.kt");
@@ -8768,6 +8768,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/defaultArguments/useNextParamInLambda.kt");
}
@TestMetadata("useNextParamInLambdaTailrec.kt")
public void testUseNextParamInLambdaTailrec() throws Exception {
runTest("compiler/testData/codegen/box/defaultArguments/useNextParamInLambdaTailrec.kt");
}
@TestMetadata("useThisInLambda.kt")
public void testUseThisInLambda() throws Exception {
runTest("compiler/testData/codegen/box/defaultArguments/useThisInLambda.kt");
@@ -8733,6 +8733,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/defaultArguments/useNextParamInLambda.kt");
}
@TestMetadata("useNextParamInLambdaTailrec.kt")
public void testUseNextParamInLambdaTailrec() throws Exception {
runTest("compiler/testData/codegen/box/defaultArguments/useNextParamInLambdaTailrec.kt");
}
@TestMetadata("useThisInLambda.kt")
public void testUseThisInLambda() throws Exception {
runTest("compiler/testData/codegen/box/defaultArguments/useThisInLambda.kt");
@@ -4914,6 +4914,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/defaultArguments/useNextParamInLambda.kt");
}
@TestMetadata("useNextParamInLambdaTailrec.kt")
public void testUseNextParamInLambdaTailrec() throws Exception {
runTest("compiler/testData/codegen/box/defaultArguments/useNextParamInLambdaTailrec.kt");
}
@TestMetadata("useThisInLambda.kt")
public void testUseThisInLambda() throws Exception {
runTest("compiler/testData/codegen/box/defaultArguments/useThisInLambda.kt");