Files
kotlin-fork/js/js.translator/testData/native/cases/passTopLevelFunctionFromNative.kt
T
2015-09-18 10:14:34 +03:00

20 lines
392 B
Kotlin
Vendored

package foo
@native
fun nativeFun(i:Int, s:String): String = noImpl
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"
}