mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-04-04 08:31:30 +00:00
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:
@@ -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);
|
||||
|
||||
17
compiler/testData/codegen/box/superConstructorCall/kt11833_1.kt
vendored
Normal file
17
compiler/testData/codegen/box/superConstructorCall/kt11833_1.kt
vendored
Normal 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()
|
||||
}
|
||||
19
compiler/testData/codegen/box/superConstructorCall/kt11833_2.kt
vendored
Normal file
19
compiler/testData/codegen/box/superConstructorCall/kt11833_2.kt
vendored
Normal 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()
|
||||
}
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user