On Sunday, 13 September 2020 at 19:16:24 UTC, Steven Schveighoffer wrote:
On 9/13/20 2:33 PM, DlangUser38 wrote:
[...]

I can't think of any other case where getting allMembers returns something other than an Identifier. It's super surprising that something returned by allMembers is not actually a member of the thing you got it from.

Arguably, NO imports that aren't renamed or aliased should be included in the members.

[...]

Yeah, I don't know the intention originally. But I have definitely done exactly what the thread author stated (used __traits(getMember) on all the module to look for certain symbols). So my code would be broken too.

Essentially, when you don't care about imports, they get ignored even if they were there by error. But when __traits(getMember) actually fails, now it becomes a problem.

Honestly, I've never used __traits(allMembers, module) to look for imports. Most likely many people don't, since it doesn't work how you would ever expect. I'd rather we just got rid of that part of the output than break code that doesn't care about imports, but does care about the other things in the module. I don't want to have to write extra mixins to rule this stuff out.

-Steve

I'm not sure if I react exactly to your answer but I agree that getMember should have a counter part. This point was not raised during the review. Previously getMember worked but you could just do nothing with the "std" when it was for "std.stdio".

Reply via email to