[Issue 14688] New: dmd writes paren-less expression in generated .di, subsequently refuses it

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jun 11 21:55:23 PDT 2015


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

          Issue ID: 14688
           Summary: dmd writes paren-less expression in generated .di,
                    subsequently refuses it
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: andrei at erdani.com

This function:

int fun()(int a, int b)
{
    if ((a > 0) | (b > 0)) return 4;
    return 3;
}

when put through the .di generator, results in this code:

int fun()(int a, int b)
{
        if (a > 0 | b > 0)
                return 4;
        return 3;
}

Subsequently dmd doesn't like the paren-less expression, causing a compile-time
error.

--


More information about the Digitalmars-d-bugs mailing list