www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - When you use the wrong bitmask, but is works out anyway

reply Dennis <dkorpel gmail.com> writes:
This dmd internal bug (or lack of a bug?) blew my mind, thought 
I'd share:

https://github.com/dlang/dmd/pull/16752
Jul 24
parent Basile B. <b2.temp gmx.com> writes:
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
Jul 24