Issue 8716 - Top-level module should have package access to itself #1556

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@ghost

ghost commented Jan 26, 2013

http://d.puremagic.com/issues/show_bug.cgi?id=8716

A top-level module such as module foo; should have access to its own symbols if they're declared as having package access. This didn't work before as the implementation expected to always find a parent of a module which is a package, but top-level modules don't have packages.

Contributor

denis-sh commented Jan 27, 2013

Please clarify/add tests about such package-less package symbols using from other modules.

@ghost

ghost commented Jan 27, 2013

@andralex:

We'll need to decide on this case:

module foo;

module bar;

If foo has package symbols, should bar have access to these symbols? Technically neither of the modules are part of any package, so in that case should the package access specifier allow all modules without a package to have access to these symbols, or should we treat package as private?

Owner

andralex commented Jan 27, 2013

I'm unclear whether a package-less module should be considered part of an implicit package "current directory", or no package at all. I prefer the latter choice, in which case any use of package-level protection should be a compilation error. cc @WalterBright

@ghost

ghost commented Sep 17, 2013

Any new thoughts since 8 months ago? Go-ahead or destroy it?

@ghost

ghost commented Apr 24, 2014

@andralex @WalterBright: This is a pretty low-overhead feature AFAICT, any news on a decision?

@ghost ghost closed this Apr 24, 2014

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment