JS: Inlined local declarations should be positioned after imports
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1282
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
|
||||
interface I {
|
||||
fun ok(): String
|
||||
}
|
||||
|
||||
inline fun ok(): I {
|
||||
return object : I {
|
||||
override fun ok() = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
@JsName("convolutedOk")
|
||||
inline fun convolutedOk(): I {
|
||||
val fail = object : I {
|
||||
override fun ok() = "fail"
|
||||
}.ok()
|
||||
|
||||
println(fail)
|
||||
|
||||
return ok()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val ok = js("_").convolutedOk()
|
||||
if (ok !is I) return "fail"
|
||||
|
||||
return ok.ok()
|
||||
}
|
||||
Reference in New Issue
Block a user