My d code doesn't compile using ldc2 1.0.0-alpha or anything above DMD v2.068.0

Using these compilers I get a lot of "Warning: statement is not reachable". Then the both compiler crashes.

I minimized the code to get the same warning, although the compilers do not crash this time, so this might not be the real culprit.

Any suggestion how to fix this?
Thanks!

ldc2 -w reach.d
dmd -w reach.d

reach.d:

    struct Tag {}

    template isTagged(S) {
      enum bool isTagged =
        delegate() {
          foreach(attr; __traits(getAttributes, S)) {
            static if (is(attr == Tag)) {
              return true;
            }
          }
          return false;
        }();
    }

    void main() {
      static @Tag struct MyStruct {}
      static struct VanillaStruct {}
      static assert(isTagged!MyStruct);
      static assert(!isTagged!VanillaStruct);
    }

Reply via email to