[Issue 18508] New: Using statement without effect should error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 23 17:57:26 UTC 2018


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

          Issue ID: 18508
           Summary: Using statement without effect should error
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: greensunny12 at gmail.com

cat << EOF | dmd -c -o- -
int f(int a){ return a; }
void main()
{
    int a;
    a=f(0),f(1);
    assert(a==1);
}
EOF

It already errors for

cat << EOF | dmd -c -o- -
int f(int a){ return a; }
void main()
{
    int a;
    a=0,1;
    assert(a==1);
}
EOF

--


More information about the Digitalmars-d-bugs mailing list