Bug 20694 – "did you mean <a protected/private member>"

Status
RESOLVED
Resolution
DUPLICATE
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-03-23T02:22:22Z
Last change time
2020-03-23T07:02:03Z
Keywords
diagnostic
Assigned to
No Owner
Creator
Adam D. Ruppe

Comments

Comment #0 by destructionator — 2020-03-23T02:22:22Z
--- module a1; class A { protected void foo(); } --- and --- import a1; void main() { auto a = new A; a.foo(); } --- a2.d(5): Error: no property foo for type a1.A, did you mean a1.A.foo? It works if public of course, but if protected or private it gives a silly error. on private, it should probably not suggest anything; private members are supposed to be invisible. But the protected case should probably explicitly call out that it is protected and thus inaccessible.
Comment #1 by pro.mathias.lang — 2020-03-23T07:02:03Z
Duplicate of 20637 which has been fixed in master *** This issue has been marked as a duplicate of issue 20637 ***