allMembers broke for __
rikki cattermole
rikki at cattermole.co.nz
Sat Jun 16 06:52:45 UTC 2018
On 16/06/2018 6:47 PM, Jonathan M Davis wrote:
> On Saturday, June 16, 2018 06:08:17 DigitalDesigns via Digitalmars-d wrote:
>> When an identifier starts with __, allMembers does not return it.
>> This is very bad behavior! It can silently create huge problems
>> if the programmer is not aware of the bug.
>>
>> Instead, if you want to keep the current behavior at least create
>> an error or warning rather than silently create a bug to waste
>> the users time tracking it down.
>
> I would point out that identifiers that start with two underscores are
> supposed to be reserved for the compiler. Declaring them yourself is begging
> for trouble in general.
>
> - Jonathan M Davis
We discussed this on IRC yesterday.
What we decided that we thought was correct was to emit a warning if __*
was used for an identifier outside of core.*. But make things like
allMembers not check for it.
Simple, but effective.
More information about the Digitalmars-d
mailing list