Files
kotlin-fork/js/js.translator/testData/native/cases/passTopLevelFunctionFromNative.kt
T
2014-07-30 17:50:16 +04:00

19 lines
393 B
Kotlin

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