[Issue 11878] New: UFCS for base-2 literals too

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 7 15:57:00 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11878

           Summary: UFCS for base-2 literals too
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2014-01-07 15:56:50 PST ---
void foo(int x) {}
void main() {
    33.foo; // OK
    0b100001.foo; // Error
    0x21.foo; // Error
}


DMD 2.065alpha gives a colorful group of error messages:


test.d(4): Error: found 'b100001' when expecting ';' following statement
test.d(5): Error: exponent required for hex float
test.d(5): Error: found 'oo' when expecting ';' following statement
test.d(5): Warning: use '{ }' for an empty statement, not a ';'


I think the "0b100001.foo;" case could be accepted.


Note that currently the situation with float literals is OK:

import std.stdio;
void f(float x) {
    writeln(x);
}
void main() {
    33.f; // calls f.
    float x = 33.0f; // float literal.
}


So perhaps this is also a bug report for hex float literals.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list