Restore anonymous classes for local delegate metadatas in inline functions

The problem is that now that the local delegated property metadata is in
the $$delegatedProperties array of the containing class, the access to
it from code calling an inline function with a local delegated property
is illegal.

Currently it seems to be a lot of work to support this rather rare case
properly (see the comment in ExpressionCodegen.getVariableMetadataValue)
so we postpone it and return the old behavior of using the anonymous
KProperty subclass for metadata
This commit is contained in:
Alexander Udalov
2017-06-14 13:21:09 +03:00
parent 616d575fb6
commit 2611c7de7e
14 changed files with 216 additions and 14 deletions
@@ -1354,6 +1354,18 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/delegatedProperty/local.kt");
doTest(fileName);
}
@TestMetadata("localInAnonymousObject.kt")
public void testLocalInAnonymousObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/delegatedProperty/localInAnonymousObject.kt");
doTest(fileName);
}
@TestMetadata("localInLambda.kt")
public void testLocalInLambda() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/delegatedProperty/localInLambda.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/boxInline/enclosingInfo")