9a5abf368f
In a constraint system a new bound is incorporated: all new constrains that can be derived from it (and from existing ones) are added
13 lines
279 B
Kotlin
Vendored
13 lines
279 B
Kotlin
Vendored
// !CHECK_TYPE
|
|
|
|
package g
|
|
|
|
import java.util.HashSet
|
|
fun <T, C: Collection<T>> convert(src: Collection<T>, dest: C): C = throw Exception("$src $dest")
|
|
|
|
fun test(l: List<Int>) {
|
|
//todo should be inferred
|
|
val r = convert(l, HashSet())
|
|
checkSubtype<Collection<Int>>(r)
|
|
}
|