Fix for KT-11634: UOE in ConstructorContext.getOuterExpression for super call in delegation

#KT-11634 Fixed
This commit is contained in:
Michael Bogdanov
2016-07-19 16:53:01 +03:00
parent ae06f01c95
commit 6f41e3b462
6 changed files with 145 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
interface A {
fun foo(): String
}
open class Base (val p: String) {
open val a = object : A {
override fun foo(): String {
return p
}
}
}
open class Derived1 (p: String): Base(p) {
override open val a = object : A {
override fun foo(): String {
return "fail"
}
}
inner class Derived2(p: String) : Base(p) {
val x = object : A by super<Base>@Derived1.a {}
}
}
fun box(): String {
return Derived1("OK").Derived2("fail").x.foo()
}