Error or a new behaviour with 2.071.0

Daniel Kozak via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 8 06:28:15 PDT 2016


 From https://dlang.org/spec/attribute.html#ProtectionAttribute

Protection does not participate in name lookup. In particular, if 
two symbols with the same name are in scope, and that name is 
used unqualified then the lookup will be ambiguous, even if one 
of the symbols is inaccessible due to protection. For example:

module A;
private class Foo {}
module B;
public class Foo {}
import A;
import B;

Foo f1; // error, could be either A.Foo or B.Foo
B.Foo f2; // ok


But Foo f1; // works ok now with 2.071.0


More information about the Digitalmars-d mailing list