Files
kotlin-fork/js/js.translator/testData/box/inline/inlinedObjectLiteralIsCheck.kt
T
Shagen Ogandzhanian 55a5695fc0 [JS] Forbid export of interfaces
With the only exception of external interfaces.

See https://youtrack.jetbrains.com/issue/KT-44099
2020-12-29 20:43:57 +01:00

28 lines
428 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1282
interface I {
fun ok(): String
}
inline fun ok(): I {
return object : I {
override fun ok() = "OK"
}
}
@JsName("convolutedOk")
@JsExport
inline fun convolutedOk(): I {
val fail = object : I {
override fun ok() = "fail"
}.ok()
return ok()
}
fun box(): String {
val ok = js("_").convolutedOk()
if (ok !is I) return "fail"
return ok.ok()
}