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

           Summary: Value range analysis in triple operator too
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from [email protected] 2014-04-03 10:41:04 PDT ---
Value range analysis could be extended to cover this case too:


void main() {
    ulong x = 10_000_000;
    uint y = (x <= uint.max) ? x : 0;
}


dmd 2.066alpha gives:

test.d(3,14): Error: cannot implicitly convert expression (x <= 4294967295LU ?
x : 0LU) of type ulong to uint

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

Reply via email to