Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strange behavior of Set4 in scala 2.9.1?

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?

like image 623
Rinat Tainov Avatar asked Sep 15 '11 13:09

Rinat Tainov


1 Answers

Yes. This is a compiler bug, go ahead and report it.

like image 139
jpalecek Avatar answered Sep 23 '22 18:09

jpalecek