Bug 20998 – error in static struct initialization causes wrong position for subsequent members, producing extra errors

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-07-01T07:04:38Z
Last change time
2021-11-08T20:45:37Z
Keywords
diagnostic, pull
Assigned to
No Owner
Creator
elpenguino+D

Comments

Comment #0 by elpenguino+D — 2020-07-01T07:04:38Z
``` struct X { void* ptr; int x; } X x = { invalid, 2 }; ``` This code correctly produces "Error: undefined identifier invalid" but then produces an unexpected "Error: cannot implicitly convert expression 2 of type int to void*". This code should only produce the first error. This incorrect behaviour appears to have been introduced at some point between DMD 2.063 and 2.064.
Comment #1 by moonlightsentinel — 2020-07-01T09:04:57Z
Comment #2 by dlang-bot — 2021-11-05T08:28:56Z
@BorisCarvajal created dlang/dmd pull request #13269 "Fix Issue 20998 - error in static struct initialization causes wrong position for subsequent members…" fixing this issue: - Fix Issue 20998 - error in static struct initialization causes wrong position for subsequent members, producing extra errors https://github.com/dlang/dmd/pull/13269
Comment #3 by dlang-bot — 2021-11-05T10:04:44Z
dlang/dmd pull request #13269 "Fix Issue 20998 - error in static struct initialization causes wrong position for subsequent members…" was merged into stable: - 4b58e4a79f51e1014fca0e932bd65fe14a67a203 by Boris Carvajal: Fix Issue 20998 - error in static struct initialization causes wrong position for subsequent members, producing extra errors https://github.com/dlang/dmd/pull/13269
Comment #4 by dlang-bot — 2021-11-08T20:45:37Z
dlang/dmd pull request #13279 "Merge `stable` into `master`" was merged into master: - c9733e805d5730ec3be5a297f08d8b050086a201 by Boris Carvajal: Fix Issue 20998 - error in static struct initialization causes wrong position for subsequent members, producing extra errors https://github.com/dlang/dmd/pull/13279