我记得 PaulP 展示了一个很酷的技巧来缩写重复的长@specialized
序列,但我再也找不到原来的帖子了。就像我有
trait Foo[@specialized(Int, Float, Double, Long, Char, Boolean) A]
trait Bar[@specialized(Int, Float, Double, Long, Char, Boolean) A]
有可能以某种方式对其进行别名...
type SpecDef = ???
trait Foo[SpecDef ??? A]
trait Bar[SpecDef ??? A]