KT-11960: add test for case of instantiating inner class of a local class
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// Enable when KT-12566 gets fixed
|
||||
|
||||
fun box(): String {
|
||||
var log = ""
|
||||
|
||||
var s: Any? = null
|
||||
for (t in arrayOf("1", "2", "3")) {
|
||||
class C() {
|
||||
val y = t
|
||||
|
||||
inner class D() {
|
||||
fun foo() = "($y;$t)"
|
||||
}
|
||||
}
|
||||
|
||||
if (s == null) {
|
||||
s = C()
|
||||
}
|
||||
|
||||
log += (s as C).D().foo()
|
||||
}
|
||||
|
||||
if (log != "(1;1)(1;1)(1;1)") return "fail: ${log}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user