http://d.puremagic.com/issues/show_bug.cgi?id=9546
Summary: getProtection trait does not work with mixin or getMember Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: andrej.mitrov...@gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2013-02-19 20:37:50 PST --- /imorts/a.d: --------------------------- module imports.a; class S { private int privA; protected int protA; package int packA; } --------------------------- /test.d: --------------------------- import imports.a; void main() { S s; static assert(__traits(getProtection, s.privA) == "private"); static assert(__traits(getProtection, s.protA) == "protected"); static assert(__traits(getProtection, s.packA) == "package"); /** NG - symbols not accessible */ static assert(__traits(getProtection, mixin("s.privA")) == "private"); static assert(__traits(getProtection, mixin("s.protA")) == "protected"); static assert(__traits(getProtection, mixin("s.packA")) == "package"); /** NG - symbols not accessible */ static assert(__traits(getProtection, __traits(getMember, s, "privA")) == "private"); static assert(__traits(getProtection, __traits(getMember, s, "protA")) == "protected"); static assert(__traits(getProtection, __traits(getMember, s, "packA")) == "package"); } --------------------------- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------