http://d.puremagic.com/issues/show_bug.cgi?id=7868

           Summary: derivedMembers/static if regression
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: c...@klickverbot.at


--- Comment #0 from klickverbot <c...@klickverbot.at> 2012-04-08 20:31:56 PDT 
---
The following snippet compiles on DMD 2.058, but fails using DMD 2.059 Git
(d16cfe5):

---
mixin template A() {
  alias typeof(this) This;

  pragma(msg, "This is true: ", is(B!This));

  static if (is(B!This)) {
    B!This b;
  } else {
    pragma(msg, "But wasn't in the static if.");
  }

  pragma(msg, "Here again, though: ", is(B!This));
}

template B(T) {
  mixin({
    foreach (name; __traits(derivedMembers, T)) {}
    return "struct B {}";
  }());
}

struct C {
  int d;
  mixin A!();
}

auto e = C.init.b;
---

DMD 2.059 prints:
---
This is true: true
But wasn't in the static if.
Here again, though: true
test.d(27): Error: not a property C(0).b
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to