Bug 12813 – Parser is confused between float and UFC syntax
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-05-27T20:36:00Z
Last change time
2014-06-22T21:23:32Z
Keywords
pull, spec
Assigned to
nobody
Creator
ibuclaw
Comments
Comment #0 by ibuclaw — 2014-05-27T20:36:18Z
According to the docs (lex)
"""
Floating literals can have embedded ‘_’ characters, which are ignored. The embedded ‘_’ are useful for formatting long literals to make them more readable, such as using them as a thousands separator
"""
And the following examples are given as valid.
123_456.567_8 // 123456.5678
1_2_3_4_5_6_._5_6_7_8 // 123456.5678
1_2_3_4_5_6_._5e-6_ // 123456.5e-6
However:
123_456.567_8 // OK
1_2_3_4_5_6_._5_6_7_8 // ERROR no property '_5_6_7_8' for type 'int'
1_2_3_4_5_6_._5e-6_ // ERROR no property '_5e' for type 'int'
Marking as regression because this would have been fine before UFCs.