Files
kotlin-fork/js/js.translator/testData/box/native/passTopLevelFunctionFromNative.kt
T
2018-09-12 09:49:25 +03:00

21 lines
463 B
Kotlin
Vendored

// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1282
package foo
external fun nativeFun(i:Int, s:String): String = definedExternally
fun bar(funRef: (Int, String) -> String): String = funRef(4, "boo")
fun box(): String {
var r = nativeFun(4, "boo")
if (r != "nativeFun 4 boo") return r
r = bar(::nativeFun)
if (r != "nativeFun 4 boo") return r
r = (::nativeFun)(4, "boo")
if (r != "nativeFun 4 boo") return r
return "OK"
}