Files
kotlin-fork/js/js.translator/testData/box/native/passMemberOrExtFromNative.kt
T
Zalim Bashorov b02279de14 [Wasm] Run wasm test using all available VMs: V8 & SpiderMonkey for now
Also, add a new directive, `WASM_FAILS_IN`, to specify VMs where a test is expected to fail for now.

#KT-56166 Fixed
2023-01-27 17:57:50 +01:00

21 lines
452 B
Kotlin
Vendored

// WASM_FAILS_IN: SM
// EXPECTED_REACHABLE_NODES: 1285
package foo
external class A(v: String) {
val v: String
fun m(i:Int, s:String): String = definedExternally
}
fun bar(a: A, extLambda: A.(Int, String) -> String): String = a.(extLambda)(4, "boo")
fun box(): String {
val a = A("test")
assertEquals("A.m test 4 boo", a.m(4, "boo"))
assertEquals("A.m test 4 boo", bar(a, fun A.(i, s) = (A::m)(this, i, s)))
return "OK"
}