www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18508] New: Using statement without effect should error

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 puremagic.com
          Reporter: greensunny12 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

--
Feb 23 2018