Transform *Array.size to properties

This commit is contained in:
Denis Zharkov
2015-10-14 13:56:18 +03:00
parent b050324869
commit bd37a10677
38 changed files with 147 additions and 107 deletions
@@ -2,9 +2,9 @@ package c
import java.util.ArrayList
fun Array<Int>.toIntArray(): IntArray = this.<!TYPE_INFERENCE_UPPER_BOUND_VIOLATED!>mapTo<!>(IntArray(size()), {it})
fun Array<Int>.toIntArray(): IntArray = this.<!TYPE_INFERENCE_UPPER_BOUND_VIOLATED!>mapTo<!>(IntArray(size), {it})
fun Array<Int>.toArrayList(): ArrayList<Int> = this.mapTo(ArrayList<Int>(size()), {it})
fun Array<Int>.toArrayList(): ArrayList<Int> = this.mapTo(ArrayList<Int>(size), {it})
public fun <T, R, C: MutableCollection<in R>> Array<out T>.mapTo(result: C, transform : (T) -> R) : C =
throw Exception("$result $transform")