Lower bound must be a subtype of the upper bound.

The change in CommonSupertypes:

 We used to say that commonSupertype(Inv<A>, Inv<B>) = Inv<in Intersect(A, B)). This is counter-intuitive, should be Inv<out commonSupertype(A, B)>
This commit is contained in:
Andrey Breslav
2014-08-25 17:51:02 +04:00
parent e232697da1
commit 6cb1d2e3f7
4 changed files with 16 additions and 8 deletions
+5 -1
View File
@@ -36,4 +36,8 @@ open class ArrayList<E>() : Any, AbstractList<E?>, List<E?>
fun f() : Unit {}
fun f(a : Int) : Int {a}
fun f(a : Float, b : Int) : Float {a}
fun f<T>(a : Float) : T {a}
fun f<T>(a : Float) : T {a}
trait Parent
trait A: Parent
trait B: Parent