Files
kotlin-fork/compiler/testData/codegen/box/mixedNamedPosition/simple.kt
T
Denis Zharkov e54d2c7c32 Support named arguments in their own position
^KT-7745 In Proggress
2019-10-02 11:13:15 +03:00

16 lines
368 B
Kotlin
Vendored

// !LANGUAGE: +NewInference +MixedNamedArgumentsInTheirOwnPosition
fun foo(
p1: Int,
p2: String,
p3: Double
) = "$p1 $p2 ${p3.toInt()}"
fun box(): String {
if (foo(p1 = 1, "2", 3.0) != "1 2 3") return "fail 1"
if (foo(1, "2", p3 = 3.0) != "1 2 3") return "fail 2"
if (foo(p1 = 1, p2 = "2", 3.0) != "1 2 3") return "fail 3"
return "OK"
}