typechecking - Transitivity of upper bound constraints in scala type checking -
i'm experimenting type-level programming in scala. think following code should type check,
trait t[x] { type t <: x } trait a[x, e <: t[t[x]]] extends t[x] { final type t = e # t # t }
but keep getting following type error:
error: overriding type t in trait t bounds <: x; type t has incompatible type trait a[x, e <: t[t[x]]] extends t[x] { final type t = e # t # t } ^ nothing <: a.this.t? true a.this.t <: x? false
i though constraint type t <: x
in trait t
whould force e#t <: t[x]
, e#t#t <: x
. wrong?
Comments
Post a Comment