digitalmars.D.bugs - [Issue 17973] New: getSymbolsByUDA deprecation message: symbol not
- d-bugmail puremagic.com (38/41) Nov 08 2017 https://issues.dlang.org/show_bug.cgi?id=17973
https://issues.dlang.org/show_bug.cgi?id=17973 Issue ID: 17973 Summary: getSymbolsByUDA deprecation message: symbol not visible from std.traits Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: minor Priority: P1 Component: phobos Assignee: nobody puremagic.com Reporter: zorael gmail.com Arch linux amd64, tested on dmd 2.077.0 and LDC 1.5.0 (based on 2.075.1). Related: https://issues.dlang.org/show_bug.cgi?id=15907 Using getSymbolsByUDA in a context where it ends up looking at private symbols gives a deprecation message, the same as in the bug linked above. This includes private symbols in the current module. alphaglosined in #d did not consider it to be a bug (though based on a more elaborate example using mixins), so this may be intended behaviour.alphaglosined | you can create an issue if you want, my intearpretation suggests that it is working correctly alphaglosined | the work done on visibility checking for traits isn't very old, so there could be some bugs in there that I haven't considered ;) B4S1L3 | ideally protection should be bypassed for most of the __traits() and people should use getProtection and decide to follow the protection attribs seamnatic or not.Heavily reduced: ------------------------------ module app; import std.traits; private: SomeUDA void foo() {} public: struct SomeUDA {} void main() { foreach (member; getSymbolsByUDA!(app, SomeUDA)) {} // current module } ----------------------------- /usr/include/dlang/dmd/std/traits.d-mixin-7761(7761,19): Deprecation: app.foo is not visible from module traits --
Nov 08 2017