KT-2106 Mixed named and positional arguments should be allowed

#KT-2106 Fixed
This commit is contained in:
Andrey Breslav
2013-01-30 21:03:36 +04:00
parent 8fd59feb21
commit 2d2c44ca9d
6 changed files with 36 additions and 46 deletions
@@ -0,0 +1,16 @@
fun foo(a: String = "Default", b: Int = 1, c: Long = 2): String {
return "$a $b $c"
}
fun box(): String {
val test1 = foo("test1", 2, c = 3)
if (test1 != "test1 2 3") return test1
val test2 = foo("test2", c = 3)
if (test2 != "test2 1 3") return test2
val test3 = foo("test3", b = 3)
if (test3 != "test3 3 2") return test3
return "OK"
}