On Thursday, 23 April 2026 at 15:25:35 UTC, H. S. Teoh wrote:

I hate D's policy on integer conversions.

The funny fact is: during CTFE this promotion to int is NOT done.

for(ubyte i = 0; i<256; ++i) ...

This works, because i is promoted to int so it can an will reach 256. But during CTFE this is an infinite loop, because an ubyte is always <256

One of the bugs that caught me on surprise.
        • Re:... Dom Disc via Digitalmars-d-learn
        • Re:... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
        • Re:... Nick Treleaven via Digitalmars-d-learn
          • ... Meta via Digitalmars-d-learn
            • ... Nick Treleaven via Digitalmars-d-learn
            • ... Dom Disc via Digitalmars-d-learn
            • ... Andy Valencia via Digitalmars-d-learn
            • ... Nick Treleaven via Digitalmars-d-learn
            • ... Dom Disc via Digitalmars-d-learn
            • ... Nick Treleaven via Digitalmars-d-learn
  • Re: Operator dec... Dom Disc via Digitalmars-d-learn

Reply via email to