http://d.puremagic.com/issues/show_bug.cgi?id=4533
Summary: Ban public aliases to private symbols Product: D Version: D1 & D2 Platform: Other OS/Version: All Status: NEW Keywords: accepts-invalid Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: tomeks...@gmail.com --- Comment #0 from Tomasz SowiĆski <tomeks...@gmail.com> 2010-07-29 13:59:12 PDT --- This module compiles fine...: module A; private void foo(); public alias foo goo; ... but try to use goo...: module B; import A; void main() { goo(); } ... and an error comes up: Error: function A.foo is not accessible from B We had a long discussion on digitalmars.D whether visibility-expanding aliases should be functional or not. If they were allowed, in some cases (member functions) the very presence of the alias could alter the generated code (think of class invariants, exposing public members to exe/dll, etc). So the conclusion was to cut the problem in the nip and retain the primary idea of aliases as mere helper symbol references whose existence ought not to be manifested in binary code. In other words, an alias whose visibility > than aliased symbol should fail already on the declaration spot. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------