Bug 13197 – 'package' visibility bug

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-24T07:24:58Z
Last change time
2024-12-13T18:22:46Z
Assigned to
No Owner
Creator
Manu
Moved to GitHub: dmd#17671 →

Comments

Comment #0 by turkeyman — 2014-07-24T07:24:58Z
I have a problem where a base class has some member with package protection, and a class that derives from the base seems to hijack the base classes visibility constraints. In the example in f(), i can access the base class directly, but I can't access it via the derived class, even though it should (?) be accessible... If i 'cast(C)D", then I can call f(), as expected. I shouldn't have to perform this case to access package visible base members. ----------------------- module x.a; import x.y; // import class C import x.y.z; // import class D : C void f() { C c; c.f(); // no problem, C is declared in the same package D d; d.f(); // error! D doesn't define f(), C does, and we have access to C as demonstrated above } ----------------------- module x.y; class C { package: void f() { } } ----------------------- module x.y.z; class D : C { }
Comment #1 by dlang-bot — 2021-06-30T02:58:31Z
@thewilsonator created dlang/dmd pull request #12786 "Add test case for issue 13197" mentioning this issue: - Add test case for issue 13197 https://github.com/dlang/dmd/pull/12786
Comment #2 by robert.schadek — 2024-12-13T18:22:46Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17671 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB