JVM: rename this$0 when regenerating nested objects too

In the old backend, this was unnecessary because nested objects would
reference their lambdas' captures through the original this$0. On
JVM_IR, using loose capture fields means a name/descriptor clash can
occur on any level of nesting, not just the top.
This commit is contained in:
pyos
2021-02-03 14:52:14 +01:00
committed by max-kammerer
parent ec89cb2313
commit 1310a65f0c
13 changed files with 180 additions and 56 deletions
@@ -506,6 +506,16 @@ public class IrJsCodegenInlineES6TestGenerated extends AbstractIrJsCodegenInline
runTest("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_3.kt");
}
@TestMetadata("kt8668_nested.kt")
public void testKt8668_nested() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_nested.kt");
}
@TestMetadata("kt8668_nested_2.kt")
public void testKt8668_nested_2() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_nested_2.kt");
}
@TestMetadata("twoDifferentDispatchReceivers.kt")
public void testTwoDifferentDispatchReceivers() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoDifferentDispatchReceivers.kt");
@@ -506,6 +506,16 @@ public class IrJsCodegenInlineTestGenerated extends AbstractIrJsCodegenInlineTes
runTest("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_3.kt");
}
@TestMetadata("kt8668_nested.kt")
public void testKt8668_nested() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_nested.kt");
}
@TestMetadata("kt8668_nested_2.kt")
public void testKt8668_nested_2() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_nested_2.kt");
}
@TestMetadata("twoDifferentDispatchReceivers.kt")
public void testTwoDifferentDispatchReceivers() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoDifferentDispatchReceivers.kt");
@@ -506,6 +506,16 @@ public class JsCodegenInlineTestGenerated extends AbstractJsCodegenInlineTest {
runTest("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_3.kt");
}
@TestMetadata("kt8668_nested.kt")
public void testKt8668_nested() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_nested.kt");
}
@TestMetadata("kt8668_nested_2.kt")
public void testKt8668_nested_2() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_nested_2.kt");
}
@TestMetadata("twoDifferentDispatchReceivers.kt")
public void testTwoDifferentDispatchReceivers() throws Exception {
runTest("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoDifferentDispatchReceivers.kt");