Files
kotlin-fork/js/js.translator/testData/box/native/passTopLevelFunctionFromNative.kt
T
Roman Artemev 6c8e30eb05 Fix test failures
* add metadata
 * unmute working tests
 * mute temporary broken ones
2018-08-09 20:55:50 +03:00

21 lines
463 B
Kotlin
Vendored

// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1110
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"
}