Bug 2991 – [module] Import within aggregate causes conflicts with private identifiers

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2009-05-16T06:44:00Z
Last change time
2016-03-05T14:16:24Z
Keywords
rejects-valid
Assigned to
nobody
Creator
matti.niemenmaa+dbugzilla

Comments

Comment #0 by matti.niemenmaa+dbugzilla — 2009-05-16T06:44:31Z
The following two-file code doesn't compile: b.d: private void foo() {} a.d: void foo() {} class C { import b; void bar() { foo(); } } The resulting errors from 'dmd -c a.d': a.d(3): Error: class a.C b.foo is private a.d(6): Error: function b.foo is not accessible from a If the import and/or function bar are moved to the global scope, the code is accepted. The private identifier from module b shouldn't be visible in module a, so no error should result.
Comment #1 by github-bugzilla — 2016-03-05T14:16:22Z