www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14908] New: dmd's rewrite is exposed in error message: Error:

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

          Issue ID: 14908
           Summary: dmd's rewrite is exposed in error message: Error: 's
                    += 1' is not a scalar, it is a S
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: acehreli yahoo.com

The compiler rewrites ++s as 's += 1' and uses it in an error message. This can
be confusing especially to new programmers:

struct S
{}

void main()
{
    S s;
    ++s;
}

Error: 's += 1' is not a scalar, it is a S

Ali

--
Aug 11 2015