Files
kotlin-fork/js/js.translator/testData/native/cases/passTopLevelFunctionFromNative.kt
T
2014-09-16 19:34:57 +04:00

20 lines
391 B
Kotlin

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"
}