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}
trait Ex {type T >: Int with 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}