There are a few cases of source incompatibilities with Scala 2.8.0. For example, creating an anonymous Seq
once required defining the abstract def elements : Iterator[A]
, which is now called def iterator : Iterator[A]
.
To me, a "brute force" solution is to create two branches that align to the different major scala versions.
Are there general techniques so that code like this will compile under both systems?
// Note: this code resembles techniques used by xml.NodeSeq
trait FooSeq extends Seq[ Foo ] {
def internal : Seq[ Foo ]
def elements = internal.elements
def iterator = internal.iterator // Only compiles in 2.8
// need to remove for 2.7.X
}