Bug 17973 – getSymbolsByUDA deprecation message: symbol not visible from std.traits
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-11-08T12:58:22Z
Last change time
2018-03-23T09:39:22Z
Assigned to
No Owner
Creator
JR
Comments
Comment #0 by zorael — 2017-11-08T12:58:22Z
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