added declared bound constraints directly to constraint system
added status 'hasViolatedUpperBound' class TypeConstraintsImpl now stores constraint position for each constraint, so we can filter out bound constraints and find out if the system is successful without them
This commit is contained in:
@@ -3,5 +3,24 @@ package i
|
||||
fun foo<R, T: List<R>>(r: R, list: T) {}
|
||||
|
||||
fun test1(i: Int, collection: Collection<Int>) {
|
||||
foo(i, collection)
|
||||
}
|
||||
foo(i, collection) //error
|
||||
}
|
||||
|
||||
//--------------
|
||||
fun bar<V : U, U>(v: V, u: MutableSet<U>) = u
|
||||
|
||||
fun test2(a: Any, s: MutableSet<String>) {
|
||||
bar(a, s) //error
|
||||
}
|
||||
|
||||
//--------------
|
||||
trait A
|
||||
class B
|
||||
|
||||
fun baz<T: R, R: B>(t: T, r: R) where T: A {
|
||||
|
||||
}
|
||||
|
||||
fun test3(a: A, b: B) {
|
||||
baz(a, b) //error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user