I want to be able to declare something like this:
trait Narrowable[A] extends Iterable[A] {
def narrow[B <: A & B <: AnyRef] : Iterable[B]
}
That it, the type B
should be both a subtype of A
and AnyRef
. Is this possible?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…