[Issue 18927] Regression: Number with real suffix "L" sometimes fails to compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu May 31 11:41:08 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18927

--- Comment #1 from Sophie <meapineapple at gmail.com> ---
Ok, this code does not compile either:

/Users/pineapple/Dropbox/Projects/d/mobile-td/test.d(4): Error: cannot
implicitly convert expression 20000001L of type long to float

import std.stdio;
unittest{
    alias T = float;
    T a = 20000001L;
    writeln(a);
}

This workaround does compile:

import std.stdio;
unittest{
    alias T = float;
    T a = 20000001.0L;
    writeln(a);
}

This code also compiles:

import std.stdio;
unittest{
    alias T = float;
    T a = 100L;
    writeln(a);
}

--


More information about the Digitalmars-d-bugs mailing list