[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:
+5
@@ -15820,6 +15820,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ir"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, 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