getProtection gives different result when member is accessed via getMember

Yuxuan Shui yshuiv7 at gmail.com
Sun Aug 5 01:48:08 UTC 2018


file1.d:
import std.stdio;

file2.d:
import file1;
pragma(msg, __traits(getProtection, __traits(getMember, m1, 
"std"))); // public
pragma(msg, __traits(getProtection, m1.std)); // private

Bug? Intended?


More information about the Digitalmars-d-learn mailing list