make numeric literal juxtaposition less brittle #15731
Closed
Description
The most obvious two changes would be:
- disallow
0
as a juxtaposed numeric literal coefficient:0n
would be a syntax error. - disallow juxtaposition of floating-point numeric literals with trailing
.
:1.x
would be a syntax error.
There may be others but these two strike me as clearly a good idea. One nice thing about disallowing 0
as a juxtaposed numeric literal coefficient is that it opens up as many 0x1234
syntaxes as one might ever want, so it kind of future-proofs us for that. Another nice thing is that instead of getting a surprise when they try 0x
after 0y
just working, people will get a warning as soon as they try 0y
and they can immediately learn that 0
doesn't work as a juxtaposed numeric literal coefficient.
Activity