Bug 15209 – redundant error message on invalid field access

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-10-16T02:47:00Z
Last change time
2016-01-03T14:02:09Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2015-10-16T02:47:07Z
Test case: ---- class C1 { int x; } struct S1 { alias y = C1.x; } struct S2 { int x; } class C2 { alias y = S2.x; } void main() { S1 s1; s1.y = 10; // Line 10: invalid field variable access auto c2 = new C2(); c2.y = 10; // Line 13: invalid field variable access } Output: ---- test.d(10): Error: struct test.S1 'x' is not a member test.d(10): Error: need 'this' for 'x' of type 'int' test.d(13): Error: need 'this' for 'x' of type 'int' The error "is not a member" at line 10 is redundant.
Comment #1 by k.hara.pg — 2015-10-16T02:51:38Z
Comment #2 by github-bugzilla — 2015-10-16T09:05:20Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/41fe4c145622cd116709b6fa1c922705e298048a fix Issue 15209 - redundant error message on invalid field access https://github.com/D-Programming-Language/dmd/commit/e5f4f769e7a20303d6701d090dd36de9425fa77c Merge pull request #5196 from 9rnsr/fix15209 Issue 15209 - redundant error message on invalid field access
Comment #3 by github-bugzilla — 2016-01-03T14:02:09Z