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:
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user