http://d.puremagic.com/issues/show_bug.cgi?id=7834

           Summary: Assign x%int to int without cast?
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2012-04-05 17:35:56 PDT ---
In DMD 2.059beta this code compiles with no warnings or errors:


void main(string[] args) {
    uint x;
    ubyte y = cast(ubyte)args.length;
    ubyte z = x % y;
}


So I'd like code similar to this too to compile with no need of a cast:


void main() {
    ulong x;
    int y;
    int z = x % y;
}


Currently it gives:
test.d(4): Error: cannot implicitly convert expression (x % cast(ulong)y) of
type ulong to int

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

Reply via email to