[KLIB] Fix deserialization of anonymous classes
In case of initializing property or function with anonymous object the object is being exposed outside its field/function's scope and accessible on previous level. In this case in `declarations only` mode we have unbound symbols. Fix is to force body/initializer loading in such cases. Make sure it is deserialized in `declarations'only` mode too. - Fix KT-40216 - Add test
This commit is contained in:
Generated
+5
@@ -12710,6 +12710,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ir"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
||||
}
|
||||
|
||||
@TestMetadata("anonymousClassLeak.kt")
|
||||
public void testAnonymousClassLeak() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/anonymousClassLeak.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("anonymousObjectInForLoopIteratorAndBody.kt")
|
||||
public void testAnonymousObjectInForLoopIteratorAndBody() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/anonymousObjectInForLoopIteratorAndBody.kt");
|
||||
|
||||
Generated
+5
@@ -12710,6 +12710,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ir"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("anonymousClassLeak.kt")
|
||||
public void testAnonymousClassLeak() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/anonymousClassLeak.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("anonymousObjectInForLoopIteratorAndBody.kt")
|
||||
public void testAnonymousObjectInForLoopIteratorAndBody() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/anonymousObjectInForLoopIteratorAndBody.kt");
|
||||
|
||||
+5
@@ -12775,6 +12775,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ir"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
||||
}
|
||||
|
||||
@TestMetadata("anonymousClassLeak.kt")
|
||||
public void testAnonymousClassLeak() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/anonymousClassLeak.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("anonymousObjectInForLoopIteratorAndBody.kt")
|
||||
public void testAnonymousObjectInForLoopIteratorAndBody() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ir/anonymousObjectInForLoopIteratorAndBody.kt");
|
||||
|
||||
Reference in New Issue
Block a user