[Issue 14908] New: dmd's rewrite is exposed in error message: Error: 's += 1' is not a scalar, it is a S

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Aug 11 16:12:53 PDT 2015


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

--


More information about the Digitalmars-d-bugs mailing list