Fixed exception from EA

"The constraint shouldn't contain different type variables on both sides: T <: R".
It occurred because we analyzed function literals before completion with unsubstituted (therefore wrong) expected type, and cached resulting type.
This commit is contained in:
svtk
2013-11-19 22:02:40 +04:00
parent efd5f69330
commit ca1650d31d
4 changed files with 17 additions and 40 deletions
@@ -0,0 +1,11 @@
package c
import java.util.ArrayList
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})
public inline fun <T, R, C: MutableCollection<in R>> Array<out T>.mapTo(result: C, transform : (T) -> R) : C =
throw Exception("$result $transform")