[Issue 7868] derivedMembers/static if regression

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 9 17:13:55 PDT 2012


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



--- Comment #7 from Walter Bright <bugzilla at digitalmars.com> 2012-04-09 17:14:36 PDT ---
It turns out, the A template is irrelevant. Perhaps this is clearer:

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

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

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

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

auto e = C.init.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