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
Comment #2 by github-bugzilla — 2018-06-12T10:04:09Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/f3001177457b00031875779a555ff581d9c62360 Fix Issue 15691 - Improve error message for struct member initializer https://github.com/dlang/dmd/commit/ecc8d829b473e8477110305a6666759e568d94c5 Merge pull request #8352 from RazvanN7/Issue_15691 Fix Issue 15691 - Improve error message for struct member initializer merged-on-behalf-of: Jacob Carlborg <[email protected]>