KT-1781 Can't distinguish between two constructors

#KT-1781 Fixed

 Now, if foo() and foo(vararg bar) both match the call site, the first one is preferred
This commit is contained in:
Andrey Breslav
2012-04-16 15:56:19 +04:00
parent d549e9d3a5
commit 0f98c281ab
7 changed files with 75 additions and 3 deletions
@@ -0,0 +1,10 @@
~nilary~fun foo0() : String = "noarg"
~vararg~fun foo0(vararg t : Int) : String = "vararg"
fun test0() {
`nilary`foo0()
`vararg`foo0(1)
val a = intArray()
`vararg`foo0(*a)
}
@@ -0,0 +1,10 @@
~unary~fun foo1(a : Int) : String = "noarg"
~vararg~fun foo1(a : Int, vararg t : Int) : String = "vararg"
fun test1() {
`unary`foo1(1)
`vararg`foo1(1, 1)
val a = intArray()
`vararg`foo1(1, *a)
}