When you use the wrong bitmask, but is works out anyway

Basile B. b2.temp at gmx.com
Wed Jul 24 20:27:53 UTC 2024


On Wednesday, 24 July 2024 at 20:15:51 UTC, Dennis wrote:
> This dmd internal bug (or lack of a bug?) blew my mind, thought 
> I'd share:
>
> https://github.com/dlang/dmd/pull/16752

This is why I think that a proper internal type is required for 
manipulating bit sets. The AndExp and its consort dont see the 
relationship between the operands (they are even promoted to 
`int`...

That reminds a bug reported a long time ago: switching over an 
enum is not safe at all because the switch condition is then 
promoted to `int`.

- https://issues.dlang.org/show_bug.cgi?id=24341
- https://issues.dlang.org/show_bug.cgi?id=21460


More information about the Digitalmars-d mailing list