October 10 [Issue 24803] New: __traits(location) is inconsistent with modules | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24803 Issue ID: 24803 Summary: __traits(location) is inconsistent with modules Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: minor Priority: P3 Component: dmd Assignee: nobody@puremagic.com Reporter: dkorpel@live.nl It's not allowed for modules listed on the command line, but for imported modules it returns the filename of the module it's called from. ``` import core.stdc.stdio; void main() { // Error: can only get the location of a symbol, not `onlineapp` __traits(getLocation, __traits(parent, main)); // Error: `AliasSeq!("onlineapp.d", 1, 8)` has no effect __traits(getLocation, core.stdc.stdio); } ``` -- |
Copyright © 1999-2021 by the D Language Foundation