JS: when deciding whether inner class of a local class captures this, don't check for subtyping, since frontend generates strict classes in descriptors. Remove fix for #KT-13583, since it's no more needed. Fix #KT-13792

This commit is contained in:
Alexey Andreev
2016-09-12 13:51:00 +03:00
parent 0a240b2a3a
commit 85a775375a
3 changed files with 44 additions and 6 deletions
@@ -0,0 +1,37 @@
package foo
open class X(private val x: String) {
fun foo(): String {
class B : X("fail1") {
inner class C {
fun bar() = x
}
fun baz() = C().bar()
}
return B().baz()
}
}
open class Y(private val x: String) {
fun foo(): String {
class B {
inner class C : Y("fail2") {
fun bar() = x
}
fun baz() = C().bar()
}
return B().baz()
}
}
fun box(): String {
val x = X("OK").foo()
if (x != "OK") return x
val y = Y("OK").foo()
if (y != "OK") return y
return "OK"
}