Making a migration from 2.8.1 to 2.9.1 found interesting thing. Tried to write this in console:
>>import collection.immutable.Set.Set4
>>new Set4[Int](1,2,3,4)
It gives:
java.lang.Error: Unexpected New
at scala.tools.nsc.symtab.SymbolTable.abort(SymbolTable.scala:34)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$bac
..........................
That entry seems to have slain the compiler. Shall I replayscala:660)
your session? I can re-run each line except the last one.reach(ListBuffer.scala:
[y/n]?
I am using Scala version 2.9.1.final (Java HotSpot(TM) Client VM, Java 1.6.0_26).
And same things happen with classes Set3 and Set2.
Are these known issues?
Or, maybe, I am making something wrong?
In scala 2.8.1 console it works, and returns:
res0: collection.immutable.Set.Set4[Int] = Set(1,2,3,4)
Must I report about these as bug?
Yes. This is a compiler bug, go ahead and report it.
来源:https://stackoverflow.com/questions/7431346/strange-behavior-of-set4-in-scala-2-9-1