Allow inner class to has outer super class in interpreter

This commit is contained in:
Ivan Kylchik
2021-06-04 22:56:11 +03:00
committed by TeamCityServer
parent 574c607f1c
commit 0716c557fe
2 changed files with 37 additions and 26 deletions
+21
View File
@@ -25,3 +25,24 @@ const val a2 = Outer().Middle().<!EVALUATED: `middle foo`!>foo()<!>
const val a3 = Outer().Middle().Inner().<!EVALUATED: `inner foo with outer bar = "bar"`!>foo()<!>
const val b = Outer().Middle().Inner().<!EVALUATED: `From inner: 3; from middle: 2; from outer: 1`!>getAllNums()<!>
open class A(val s: String) {
val z = s
fun test() = s
inner class B(s: String): A(s) {
fun testB(): String {
return when {
s != "OK" -> "Fail 1"
z != "OK" -> "Fail 2"
test() != "OK" -> "Fail 3"
this@A.s != "Fail" -> "Fail 4"
super.s != "OK" -> "Fail 5"
else -> "OK"
}
}
}
}
const val c = A("Fail").B("OK").<!EVALUATED: `OK`!>testB()<!>