digitalmars.D.bugs - [Issue 7236] New: Protected class members in different file inaccessible
- d-bugmail puremagic.com (45/45) Jan 05 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7236
- d-bugmail puremagic.com (10/10) Apr 19 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7236
- d-bugmail puremagic.com (6/6) Apr 21 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7236
- d-bugmail puremagic.com (6/6) Apr 21 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7236
- d-bugmail puremagic.com (6/6) Apr 23 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7236
- d-bugmail puremagic.com (12/12) Jan 13 2013 http://d.puremagic.com/issues/show_bug.cgi?id=7236
- d-bugmail puremagic.com (14/14) Feb 03 2013 http://d.puremagic.com/issues/show_bug.cgi?id=7236
- d-bugmail puremagic.com (9/11) Feb 04 2013 http://d.puremagic.com/issues/show_bug.cgi?id=7236
http://d.puremagic.com/issues/show_bug.cgi?id=7236 Summary: Protected class members in different file inaccessible Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: full.demon gmail.com Example: a.d: class A { protected: void f() { } } main.d: import a; class B: A { public: void g(A a) // using g(B b) it works { a.f(); // error } } int main() { auto b = new B; b.g(b); } dmd main.d a.d Error: class a.A member f is not accessible This is ONLY if A is in a different file (else B can access any of A its members due to module accessibility). If g accepts B instead of A it works though. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 05 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7236 SomeDude <lovelydear mailmetrash.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lovelydear mailmetrash.com PDT --- Confirmed on 2.059 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 19 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7236 PDT --- I think this is a major bug. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 21 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7236 PDT --- It also works with the following calls: f(), this.f() and super.f() -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 21 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7236 PDT --- See also on the same topic issue 5769 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 23 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7236 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull CC| |andrej.mitrovich gmail.com AssignedTo|nobody puremagic.com |andrej.mitrovich gmail.com 09:58:51 PST --- https://github.com/D-Programming-Language/dmd/pull/1478 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 13 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7236 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla digitalmars.com Resolution| |INVALID 16:52:52 PST --- This is exactly the way it is designed to work. Accessibility is determined by the 'this' pointer, not the function it is in (C++ operates the same way). And, of course, code in a module has all access to other classes in the same module. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 03 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7236 11:16:08 PST ---This is exactly the way it is designed to work. Accessibility is determined by the 'this' pointer, not the function it is in.Perhaps, but it could be a future enhancement. I'm not sure about the pros vs cons, maybe encapsulation would break under this enhancement. The damage seems limited though. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 04 2013