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:
@@ -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
|
||||
Reference in New Issue
Block a user