[Issue 13978] New: Front-end optimizer bug in OrOrExp

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jan 13 06:15:48 PST 2015


https://issues.dlang.org/show_bug.cgi?id=13978

          Issue ID: 13978
           Summary: Front-end optimizer bug in OrOrExp
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: k.hara.pg at gmail.com

Boolean-condition || void-expression should be a valid D expression, but the
following code fails to compile.

----
bool cond(bool b) { return b; }

void main()
{
    cond(true) || assert(0);
    cond(false) || assert(0);

    true || assert(0);  // Error: integral constant must be scalar type, not
void
    false || assert(0);
}

--


More information about the Digitalmars-d-bugs mailing list