Bug 3504 – [module] import foo: *; should be supported if imports are static by default
Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2009-11-13T16:24:00Z
Last change time
2015-06-09T05:13:48Z
Assigned to
nobody
Creator
leandro.lucarella
Comments
Comment #0 by leandro.lucarella — 2009-11-13T16:24:03Z
This is complementary to bug 3503 (make imports static by default). If that is the case, it would be a good idea to provide a way to have the old behavior, since it can be useful for a small set of applications (like small scripts).
A proposed syntax could be:
import foo: *;
Comment #1 by leandro.lucarella — 2009-11-14T09:39:42Z
Here is an example on how this should work with modules and packages:
mod.d:
void f() {}
pkg/a.d:
void f() {}
pkg/pkg.d:
void f() {}
x.d:
import mod: *;
import pkg: *;
void main() {
f(); // mod.f
a.f(); // pkg.a.f
pkg.f(); // pkg.pkg.f
}