private selective import + overload = breaks accessibility rules

Seb seb at wilzba.ch
Wed Jan 17 09:53:15 UTC 2018


On Wednesday, 17 January 2018 at 07:40:36 UTC, Joakim wrote:
> Are you sure about this?  I thought such module-scope selective 
> imports were supposed to be private by default since Martin's 
> fixes for bug 314, which is why you submitted pull 5584.  Bug 
> 17630 is about something different, that selective imports pull 
> symbols out of the imported module's non-selective imports, but 
> he's not using any selective imports in his module b.
>
> I ran this code example through my symbol-dumping dmd 
> (http://forum.dlang.org/thread/pbpckzwmfglzgwqveoza@forum.dlang.org) and module b from his first example is indeed getting isNaN from std.math, which implies the older bug that selective imports at module scope are still leaking out.

Well the problem is that DMD doesn't perform no checks whatsoever 
when you do selective imports. So yes, I think both bugs are 
related.
However, I re-opened 18234 as we want to include the test case to 
the testsuite gets fixed.

BTW it's a shame that https://github.com/dlang/dmd/pull/6676 
which will be pulled soon while being very close to the bugs in 
question, doesn't fix either of them.


More information about the Digitalmars-d-learn mailing list