[Bug 24] New: Arithmetic operators are allowed on boolean expressions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 7 20:17:48 PST 2006


http://d.puremagic.com/bugzilla/show_bug.cgi?id=24

           Summary: Arithmetic operators are allowed on boolean expressions
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: walter at digitalmars.com
        ReportedBy: ddparnell at bigpond.com


The operators 

 + - / * 

should cause a compilation error if one of the expressions is a boolean
datatype. 

The code below should no compile...

    auto q = true + true + true;
    bool x;
    int y;
    x = true;
    y = x / x;
    y = x * x;
    y = x - x;
    y = x + x;
    y += x;
    y -= x;
    y /= x;
    y *= x;


-- 




More information about the Digitalmars-d-bugs mailing list