[NI] Approximate captured types before type variable fixation.

We prefer denotable types when we solve constraint system.
I.e. if for T we have not equality constraint with captured type we can approximate captured type to denotable type.
This commit is contained in:
Stanislav Erokhin
2017-04-06 22:27:58 +03:00
parent b4bf534d29
commit 0fadf0bf70
6 changed files with 73 additions and 13 deletions
@@ -0,0 +1,8 @@
fun <T> Array<out T>.intersect(other: Iterable<T>) {
val set = toMutableSet()
set.retainAll(other)
}
fun <X> Array<out X>.toMutableSet(): MutableSet<X> = TODO()
fun <Y> MutableCollection<in Y>.retainAll(<!UNUSED_PARAMETER!>elements<!>: Iterable<Y>) {}
@@ -0,0 +1,5 @@
package
public fun </*0*/ T> kotlin.Array<out T>.intersect(/*0*/ other: kotlin.collections.Iterable<T>): kotlin.Unit
public fun </*0*/ Y> kotlin.collections.MutableCollection<in Y>.retainAll(/*0*/ elements: kotlin.collections.Iterable<Y>): kotlin.Unit
public fun </*0*/ X> kotlin.Array<out X>.toMutableSet(): kotlin.collections.MutableSet<X>