Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/upperBounds/conflictingSubstitutionsFromUpperBound.kt
T
Svetlana Isakova 179c5e3c3a Add a constraint for nested call
if there are no bounds on variables in this call return type
2015-07-10 15:05:04 +03:00

13 lines
280 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())
r checkType { _<HashSet<Int>>() }
}