Bug 14908 – dmd's rewrite is exposed in error message: Error: 's += 1' is not a scalar, it is a S
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2015-08-11T23:12:53Z
Last change time
2022-10-10T06:39:36Z
Keywords
diagnostic
Assigned to
No Owner
Creator
Ali Cehreli
Comments
Comment #0 by acehreli — 2015-08-11T23:12:53Z
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
Comment #1 by razvan.nitu1305 — 2022-10-10T06:39:36Z
The error is now: Error: `s` is not a scalar, it is a `S`. seems to be fixed.