Strange behaviour of __traits(allMembers)

FeepingCreature feepingcreature at gmail.com
Sun Jun 18 20:56:25 UTC 2023


On Sunday, 18 June 2023 at 10:21:16 UTC, IchorDev wrote:
> On Sunday, 18 June 2023 at 10:04:14 UTC, FeepingCreature wrote:
>> On Sunday, 18 June 2023 at 09:48:40 UTC, IchorDev wrote:
>>> Does anyone understand why this happens?
>>> Is there any way to subvert this behaviour, or is it actually 
>>> a bug?
>>
>> Yes, see also my bug report, 
>> https://issues.dlang.org/show_bug.cgi?id=20008 
>> "__traits(allMembers) of packages is complete nonsense".
>
> Whaaaaaaaaaaaaaaaaaaaaaat why has this not been fixed in the 
> last 4 years!

I think because nobody *needs* `__traits(allMembers)` of 
packages. Mostly people just learn to skip them while scanning 
modules, and instead of iterating imports, they do the standard 
hack of "generate a list of all files in the project, string 
import it, and generate import statements for each".

Yeah it's ugly. I guess the lesson is, nothing takes as long to 
fix as a bug with a well-known workaround.


More information about the Digitalmars-d-learn mailing list