Fix for KT-6722

#KT-6722 Fixed
This commit is contained in:
Michael Bogdanov
2015-10-21 14:24:31 +03:00
parent f4d3ecf8e6
commit 55d2300860
3 changed files with 19 additions and 1 deletions
@@ -1254,7 +1254,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
for (KtDeclaration declaration : myClass.getDeclarations()) {
if (declaration instanceof KtProperty) {
KtProperty property = (KtProperty) declaration;
KtExpression initializer = property.getInitializer();
KtExpression initializer = property.getDelegateExpressionOrInitializer();
if (initializer != null) {
initializer.accept(visitor);
}
@@ -0,0 +1,12 @@
interface T {
}
fun box(): String {
val a = "OK"
val t = object : T {
val foo by lazy {
a
}
}
return t.foo
}
@@ -1456,6 +1456,12 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxWithStdlib/delegatedProperty"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("kt6722.kt")
public void testKt6722() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/delegatedProperty/kt6722.kt");
doTestWithStdlib(fileName);
}
@TestMetadata("stackOverflowOnCallFromGetValue.kt")
public void testStackOverflowOnCallFromGetValue() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/delegatedProperty/stackOverflowOnCallFromGetValue.kt");