[Issue 9143] template structs with two parameters confuse DMD on multiple instantiations

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 12 11:34:06 PST 2012


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



--- Comment #1 from Puneet Goel <puneet at coverify.org> 2012-12-12 11:34:05 PST ---
Earlier I thought the problem occurs for bool parameters. But it seems to be
more generic.

A more interesting test case:
1. Line 7 fails to compile.
2. There is no problem with line 4, 5, and 6.
3. If we uncomment line 3, compiler does not complain even for line 7.

struct Foo (bool L, size_t N) {
  void baaz () {
    // bar!(Foo!(false, 2LU))(); // line 3
    // bar!(Foo!(true, 2LU))();  // line 4
    // bar!(Foo!(L, N))();       // line 5
    // bar!(Foo!(true, N))();    // line 6
    bar!(Foo!(false, N))();      // line 7
  }
  void bar (T) ()
    if (is(T unused == Foo!(_L, _N), bool _L, size_t _N))
      {}
}

void main() {
  auto p = Foo!(true, 2LU)();
  p.baaz();
}

-- 
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