Bug 555 – Integral ireal literals can't be specified
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-11-18T06:22:00Z
Last change time
2014-02-15T13:20:15Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
matti.niemenmaa+dbugzilla
Comments
Comment #0 by matti.niemenmaa+dbugzilla — 2006-11-18T06:22:42Z
ireal x = 4.Li; // works
ireal y = 4.0Li; // works
ireal z = 4Li; // fails
asdf.d(3): semicolon expected, not 'i'
asdf.d(3): no identifier for declarator i
Or:
creal x = 2L + 4.Li; // works
creal y = 3L + 4.0Li; // works
creal z = 4L + 4Li; // fails
Which shows the discrepancy - the real numbers work, but the imaginary fails.
Not that important, since you can just write 4i, but it seems inconsistent since you can write both 123.456i and 123.456Li, but not 123456i and 123456Li.
Comment #1 by matti.niemenmaa+dbugzilla — 2006-11-18T11:03:59Z
I'm now practically certain that this is a bug, since these all work:
ifloat x = 6.0fi;
ifloat y = 6.fi;
ifloat z = 6fi;