ScalaTest is throwing a ClassCastException in this method:
> private[scalatest] def parseCompoundArgIntoSet(args: List[String], expectedDashArg: String): Set[String] =
> Set() ++ parseCompoundArgIntoList(args, expectedDashArg)
The exception is:
> java.lang.ClassCastException: scala.collection.immutable.Set$EmptySet$ cannot be cast to scala.collection.generic.Addable
> at org.scalatest.tools.Runner$.parseCompoundArgIntoSet(Runner.scala:1037)
It's nothing to do with what's returned by parseCompoundArgIntoList because I get exactly the same error if I change it to:
> private[scalatest] def parseCompoundArgIntoSet(args: List[String], expectedDashArg: String): Set[String] =
> Set() ++ List()
The weird thing is that I can't reproduce it in the REPL or in any small cut-down examples. For example:
> Welcome to Scala version 2.9.0.r24166-b20110202020121 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_22).
> Type in expressions to have them evaluated.
> Type :help for more information.
>
> scala> def foo(): Set[String] = Set() ++ List()
> foo: ()Set[String]
>
> scala> foo
> res0: Set[String] = Set()
So I'm stymied. It looks, from the error, as though the deprecated Set.EmptySet is being picked up, but I can't think why that would be the case? Does anyone have any suggestions for possible avenues of investigation?
--
paul.butcher->msgCount++
Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?
http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: pa...@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher
Make sure all Scala libraries on the classpath were compiled with the
same version of scala.
-jason
--
I know that 2.8 broke binary compatibility with 2.7, but I've been told that 2.9 should be binary compatible with 2.8 (although I can't find anything definitive on the subject)? Or have I got that wrong?
That is not a stated nor a realistic goal of 2.9. 2.9.{1, .. , n}
ought to be binary compatible with 2.9.0 however.
There may be a bytecode migration tool commercially available from
Scala Solutions [1]; but the simpler option is to use binaries
compiled for 2.9.x.
-jason