Files
kotlin-fork/js/js.translator/testData/box/native/passExtLambdaToNative.kt
T
Nikolay Lunyak a20e29e8b7 [FIR JS] Implement FirJsExternalChecker
The JsAllowValueClassesInExternals feature is enabled explicitly,
because otherwise it's enabled
implicitly depending on the backend. See:
org/jetbrains/kotlin/test/builders/LanguageVersionSettingsBuilder.kt:90

A property may have a fake source return kind, while its accessor
has a real source kind. In this case we can't "just copy"
the property return type down to the accessor.
2023-01-09 08:57:11 +00:00

23 lines
512 B
Kotlin
Vendored

// IGNORE_BACKEND_K1: JS_IR
// IGNORE_BACKEND_K2: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// TODO: Unmute when extension functions are supported in external declarations.
// IGNORE_BACKEND: JS
// IGNORE_BACKEND: WASM
package foo
external class A(v: String) {
val v: String
}
external fun bar(a: A, extLambda: A.(Int, String) -> String): String = definedExternally
fun box(): String {
val a = A("test")
val r = bar(a) { i, s -> "${this.v} $i $s"}
if (r != "test 4 boo") return r
return "OK"
}