[Issue 7868] New: derivedMembers/static if regression

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 8 20:31:16 PDT 2012


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: nobody at puremagic.com
        ReportedBy: code at klickverbot.at


--- Comment #0 from klickverbot <code at 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: -------


More information about the Digitalmars-d-bugs mailing list