Files
kotlin-fork/compiler/testData/codegen/box/callableReference/function/overloadedFunVsVal.kt
T
Alexander Korepanov 6bb939c6cb [FIR JS] Support JS_NAME_CLASH and JS_FAKE_NAME_CLASH diagnostics
^KT-59425 Fixed
^KT-59370 Fixed
2023-09-08 09:55:25 +00:00

25 lines
462 B
Kotlin
Vendored

// IGNORE_BACKEND_K1: WASM
// IGNORE_BACKEND_K1: JS_IR, JS_IR_ES6
// IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
import kotlin.reflect.*
class A {
val x = 1
fun x(): String = "OK"
}
val f1: KProperty1<A, Int> = A::x
val f2: (A) -> String = A::x
fun box(): String {
val a = A()
val x1 = f1.get(a)
if (x1 != 1) return "Fail 1: $x1"
return f2(a)
}