New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ScalaCLPlugin] ClassCastException when using map with breakOut #45
Comments
Oops, I forgot to add the title, but I can't edit the issue. Please add 'ClassCastException when using map with breakOut' Google Code Info: |
Excellent, thanks a lot Ismael ! (happy to have learnt a new toy in the process, breakOut looks very useful :-)) Btw, ScalaCL also works in the console (as hinted by the reporter of issue #40 and #41) : SCALACL_VERBOSE=1 scala
Cheers Google Code Info: |
Useful to know (about console). :) Google Code Info: |
Fixed by revision #1580 in version 0.2.Beta6 (sbaz) and latest Maven 0.2-SNAPSHOT. The fix only tries to stay away from exotic CanBuildFroms, but a clean fix will wait for the upcoming version 0.3 where operation streams are planned (a.map(f1).filter(f2).map(f3).toSet or ....map(f3)(collection.breakOut) will hence be treated the same way). Thanks again for your report, CheersOlivier Google Code Info: |
Google Code Info: |
Thanks! Google Code Info: |
I tested the current snapshot in my project and all tests pass. :) Google Code Info: |
What steps will reproduce the problem?
Run the following code:
object Test2 {
def main(args: Array[String]) {
val a: Set[Int] = List(1).map(_ + 1)(collection.breakOut)
println(a)
}
}
What is the expected output? What do you see instead?
Set(2), but instead we get:
Exception in thread "main" java.lang.ClassCastException: scala.collection.immutable.$colon$colon cannot be cast to scala.collection.immutable.Set
at test1.Test2$.main(tests.scala:10)
at test1.Test2.main(tests.scala)
What version of the product are you using? On what operating system?
0.2 SNAPSHOT from today.
Google Code Info:
Issue #: 43
Author: ismaelj
Created On: 2011-01-17T22:53:29.000Z
Closed On: 2011-01-18T13:49:41.000Z
The text was updated successfully, but these errors were encountered: