-
Notifications
You must be signed in to change notification settings - Fork 21
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
Numeric literals should support "fill-in" underscores #6124
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6124?orig=1
|
@adriaanm said: |
@adriaanm said: |
@SethTisue said: |
Patience is a virtue. There's talk recently of a micro-SIP process. A beer for Martin, a whiskey for Adriaan, and you're in. But you're on the hook for Seth for like your life. scala/scala#6989 |
Sipping is already too small of a quantity to imbibe. What about a Gradually Updated Language Process? |
Does Adriaan get the Scotch or the Bourbon? and who gets the other one? Also, I assume the beer must be a micro-brew. |
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: