Fix for KT-11833: Error generating constructors of class null with kind IMPLEMENTATION on anonymous object inheriting from nested class of super class

#KT-11833 Fixed
This commit is contained in:
Michael Bogdanov
2016-07-21 10:18:10 +03:00
parent 6556cde329
commit 5dca4dbc67
5 changed files with 63 additions and 0 deletions

View File

@@ -1305,6 +1305,9 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
assert delegateExpression != null;
delegateExpression.accept(visitor);
}
else if (specifier instanceof KtSuperTypeCallEntry) {
specifier.accept(visitor);
}
}
ClassDescriptor superClass = DescriptorUtilsKt.getSuperClassNotAny(descriptor);

View File

@@ -0,0 +1,17 @@
abstract class Father {
abstract inner class InClass {
abstract fun work(): String
}
}
class Child : Father() {
val ChildInClass = object : Father.InClass() {
override fun work(): String {
return "OK"
}
}
}
fun box(): String {
return Child().ChildInClass.work()
}

View File

@@ -0,0 +1,19 @@
abstract class Father {
abstract inner class InClass {
abstract fun work(): String
}
}
class Child : Father() {
fun test(): InClass {
return object : Father.InClass() {
override fun work(): String {
return "OK"
}
}
}
}
fun box(): String {
return Child().test().work()
}

View File

@@ -7321,6 +7321,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("kt11833_1.kt")
public void testKt11833_1() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/innerNested/kt11833_1.kt");
doTest(fileName);
}
@TestMetadata("kt11833_2.kt")
public void testKt11833_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/innerNested/kt11833_2.kt");
doTest(fileName);
}
@TestMetadata("kt3132.kt")
public void testKt3132() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/innerNested/kt3132.kt");

View File

@@ -107,6 +107,18 @@ public class InnerNestedTestGenerated extends AbstractInnerNestedTest {
doTest(fileName);
}
@TestMetadata("kt11833_1.kt")
public void testKt11833_1() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/innerNested/kt11833_1.kt");
doTest(fileName);
}
@TestMetadata("kt11833_2.kt")
public void testKt11833_2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/innerNested/kt11833_2.kt");
doTest(fileName);
}
@TestMetadata("kt3132.kt")
public void testKt3132() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/innerNested/kt3132.kt");