Files
kotlin/compiler/testData/codegen/box/functions/invoke/castFunctionToExtension.kt
2019-11-19 11:00:09 +03:00

13 lines
307 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
val f = fun (s: String): String = s
val g = f as String.() -> String
if ("OK".g() != "OK") return "Fail 1"
val h = fun String.(): String = this
val i = h as (String) -> String
if (i("OK") != "OK") return "Fail 2"
return "OK"
}