D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20694 - "did you mean <a protected/private member>"
Summary: "did you mean <a protected/private member>"
Status: RESOLVED DUPLICATE of issue 20637
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 minor
Assignee: No Owner
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2020-03-23 02:22 UTC by Adam D. Ruppe
Modified: 2020-03-23 07:02 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Adam D. Ruppe 2020-03-23 02:22:22 UTC
---
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 Mathias LANG 2020-03-23 07:02:03 UTC
Duplicate of 20637 which has been fixed in master

*** This issue has been marked as a duplicate of issue 20637 ***