src/compiler/scala/tools/nsc/javac/JavaScanners.scala does NOT support literals like 123_456_789.
Since Java SE 7u4 (JDK 1.7 update 4), one can instantiate a java.lang.Long with java.lang.Long.valueOf (987_654_321).
I have prepared a "fix" for this, see the attachment.
At the same time, a similar patch adds support for underscores in numeric literals in Scala's own parser, namely src/compiler/scala/tools/nsc/ast/parser/Scanners.scala.
There is also a simple test object which compiles and runs with the two Scanners patched with the Patch files.
The text was updated successfully, but these errors were encountered:
thanks for the patch! we should improve the Java scanner, but changing Scala syntax will require a SIP
a pull request on github for the java-side of things much appreciated (please sign the Scala CLA first)