fix(JS_IR): add outer classes resolving inside the function inliner.
This commit is contained in:
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// FILE: 1.kt
|
||||
class E(val x: String) {
|
||||
inner class Inner {
|
||||
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// FILE: 1.kt
|
||||
class Outer(val a: String) {
|
||||
inner class Inner(val b: String) {
|
||||
inline fun bar() = b
|
||||
}
|
||||
inline fun foo(i: Inner) = a + i.bar()
|
||||
}
|
||||
// FILE: 2.kt
|
||||
|
||||
fun box(): String {
|
||||
val outer = Outer("O")
|
||||
val inner = outer.Inner("K")
|
||||
|
||||
return outer.foo(inner)
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// FILE: 1.kt
|
||||
class O(val a: String) {
|
||||
inner class I1(val b: String) {
|
||||
inner class I2(val c: String) {
|
||||
inner class I3(val d: String) {
|
||||
inline fun foo(e: String) = "$a $b $c $d$e"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
fun box(): String {
|
||||
val result = O("A").I1("lot").I2("of").I3("layers").foo("!")
|
||||
|
||||
if (result != "A lot of layers!") return "fail: result is $result"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// FILE: 1.kt
|
||||
class E(val x: String) {
|
||||
fun bar() = x
|
||||
inner class Inner {
|
||||
inline fun foo() = this@E::bar
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
fun box() = E("OK").Inner().foo()()
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// FILE: 1.kt
|
||||
class E<T>(val x: T) {
|
||||
inner class Inner {
|
||||
inline fun foo(): T = x
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
inline class IC(val s: String)
|
||||
|
||||
fun box(): String = E(IC("OK")).Inner().foo().s
|
||||
Reference in New Issue
Block a user