Removed toArray() from collections (few tests are still failing).

#KT-3352 in progress
This commit is contained in:
Evgeny Gerashchenko
2013-09-25 03:01:47 +04:00
parent 48625dd7b6
commit d56c59d9d7
162 changed files with 21 additions and 75 deletions
@@ -3,6 +3,8 @@ package j
fun <T : Any> T?.sure() : T = this!!
fun <E> List<*>.toArray(ar: Array<E>): Array<E> = ar
fun testArrays(ci: List<Int?>, cii: List<Int?>?) {
val c1: Array<Int?> = cii.sure().toArray(<!FUNCTION_CALL_EXPECTED!><!NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>Array<!><Int?><!>)
@@ -5,8 +5,6 @@ fun <T> testCollection(c: Collection<T>, t: T) {
c.isEmpty()
c.contains(1)
val <!UNUSED_VARIABLE!>iterator<!>: Iterator<T> = c.iterator()
val <!UNUSED_VARIABLE!>arrayOfAnys<!>: Array<Any?> = c.toArray()
val <!UNUSED_VARIABLE!>arrayOfTs<!>: Array<T> = c.toArray(array<T>())
c.containsAll(c)
val <!UNUSED_VARIABLE!>mutableIterator<!>: MutableIterator<T> = <!TYPE_MISMATCH!>c.iterator()<!>
@@ -23,8 +21,6 @@ fun <T> testMutableCollection(c: MutableCollection<T>, t: T) {
c.isEmpty()
c.contains(1)
val <!UNUSED_VARIABLE!>iterator<!>: Iterator<T> = c.iterator()
val <!UNUSED_VARIABLE!>arrayOfAnys<!>: Array<Any?> = c.toArray()
val <!UNUSED_VARIABLE!>arrayOfTs<!>: Array<T> = c.toArray(array<T>())
c.containsAll(c)
@@ -67,8 +63,6 @@ fun <T> testSet(s: Set<T>, t: T) {
s.isEmpty()
s.contains(1)
val <!UNUSED_VARIABLE!>iterator<!>: Iterator<T> = s.iterator()
val <!UNUSED_VARIABLE!>arrayOfAnys<!>: Array<Any?> = s.toArray()
val <!UNUSED_VARIABLE!>arrayOfTs<!>: Array<T> = s.toArray(array<T>())
s.containsAll(s)
val <!UNUSED_VARIABLE!>mutableIterator<!>: MutableIterator<T> = <!TYPE_MISMATCH!>s.iterator()<!>
@@ -85,8 +79,6 @@ fun <T> testMutableSet(s: MutableSet<T>, t: T) {
s.isEmpty()
s.contains(1)
val <!UNUSED_VARIABLE!>iterator<!>: Iterator<T> = s.iterator()
val <!UNUSED_VARIABLE!>arrayOfAnys<!>: Array<Any?> = s.toArray()
val <!UNUSED_VARIABLE!>arrayOfTs<!>: Array<T> = s.toArray(array<T>())
s.containsAll(s)
@@ -1,3 +1,4 @@
fun <E> List<*>.toArray(ar: Array<E>): Array<E> = ar
fun testArrays(ci : List<Int>) {
ci.toArray<Int>(<!UNRESOLVED_REFERENCE!>x<!>)