This question shows research effort; it is useful and clear
1
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
Dottyで簡単に次のことができます:
trait Ex {type T <: Int | Seq[Int]; def f:T}
trait Ex2 extends Ex {override type T = Seq[Int]; override def f = Seq(2)}
trait Ex3 extends Ex {override type T = Int; override def f = 2}