KT-422 Tune literal typing rules so that varargs overloaded by primitive types work

#KT-422 fixed
This commit is contained in:
Svetlana Isakova
2013-01-16 15:18:51 +04:00
parent b2823c5966
commit da4f1aec1d
3 changed files with 37 additions and 6 deletions
@@ -0,0 +1,17 @@
// KT-422 Tune literal typing rules so that varargs overloaded by primitive types work
fun foo<T>(vararg t : T) = t
fun foo(vararg a: Int) = a
fun foo(vararg a: Long) = a
fun test() {
foo(1, 2, 3) // Error, but should be foo of ints
}
fun <T> array(vararg elements : T) = elements
fun array(vararg elements : Int) = elements
fun test1() {
array("A", "A")
array(1, 1)
}