Fix for KT-7421: Unable to inherit from inner class

Fix for KT-6708: Compiler Error when extending open inner class: "java.lang.RuntimeException: Error generating primary constructor of class InnerB with kind IMPLEMENTATION"

  #KT-7421 Fixed
  #KT-6708 Fixed
This commit is contained in:
Michael Bogdanov
2015-10-30 16:49:38 +03:00
parent 65b85711e3
commit 15eaa15b65
9 changed files with 74 additions and 10 deletions
+12
View File
@@ -0,0 +1,12 @@
open class A() {
open inner class InnerA
}
class B : A() {
inner class InnerB : A.InnerA()
}
fun box(): String {
B().InnerB()
return "OK"
}
@@ -0,0 +1,16 @@
open class A(val s: String) {
val z = s
fun test() = s
open inner class B(s: String): A(s) {
fun testB() = z + test()
}
}
fun box(): String {
val res = A("Fail").B("OK").testB()
return if (res == "OKOK") "OK" else res;
}