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

--- Comment #0 from 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:
------- You are receiving this mail because: -------

Reply via email to