1 2 3 4 5 6 7 8 9 10 11 12
trait AbsIterator { type T def next: T } class StringIterator extends AbsIterator { type T = Char def next = 'a' } trait SyncIterator extends AbsIterator { abstract override def next: T = super.next } class I extends StringIterator with SyncIterator