Bug 15691 – Improve error message for struct member initializer
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-02-16T12:47:36Z
Last change time
2018-06-12T10:04:10Z
Assigned to
No Owner
Creator
Jacob Carlborg
Comments
Comment #0 by doob — 2016-02-16T12:47:36Z
struct Foo { int a; int b; }
void main()
{
Foo z = { // line 5
a: 3,
c: 4 // line 7
};
}
The above code will result in the following error message:
main.d(5): Error: 'c' is not a member of 'Foo'
It would be better if the error message mentioned line 7 where the actual error is, either instead of line 5 or in addition to it.
Comment #1 by razvan.nitu1305 — 2018-06-12T07:45:55Z