Bug 20531 – Error message for invalid private data access very confusing

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-01-24T03:44:01Z
Last change time
2020-03-21T03:56:41Z
Keywords
diagnostic
Assigned to
No Owner
Creator
Steven Schveighoffer

Comments

Comment #0 by schveiguy — 2020-01-24T03:44:01Z
--- mod1.d module mod1; struct S { private int x; } --- mod2.d module mod2; import mod1; void main() { S s; int x = s.x; } --- Error: no property `x` for type `S`, did you mean `mod1.S.x`? I would expect it to complain that either x doesn't exist or is not accessible. It's not helpful to say I should try doing what I actually did...
Comment #1 by b2.temp — 2020-01-26T18:32:19Z
*** This issue has been marked as a duplicate of issue 5839 ***