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:
+11
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user