On Saturday, 4 February 2017 at 08:50:42 UTC, Stefan Koch wrote:
you need to make enums into static immmutable.

If you ever worked for you when using enums you were living dangerously.

I've pushed a fix by moved the code to runtime, the static asserts to unittested asserts. Thanks for your hint still; will keep in mind for the future.

The problematic code was like this:

    class A { /* ... */ }
    struct B { A a; /* ... */ }

    enum B errorsNowDuringCTFE = /* ... */;

I wrote this over a year ago, trying to find out just how much can be forced into CTFE. The compiler accepted it, and yeah, it worked cross-platform. I imagined that 'enum' and 'static immutable' were equivalent, even though that looked like a stretch.

Keep up the good, aggressive compiler development that finds such latent bugs!

-- Simon

Reply via email to