www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12514] New: Value range analysis in triple operator too

reply d-bugmail puremagic.com writes:
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: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



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: -------
Apr 03 2014
parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12514


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies gmail.com



This is a long way beyond current VRP.

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