[Issue 9143] New: template structs with two bool parameters confuse DMD

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 11 11:09:23 PST 2012


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

           Summary: template structs with two bool parameters confuse DMD
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: puneet at coverify.org


--- Comment #0 from Puneet Goel <puneet at coverify.org> 2012-12-11 11:09:19 PST ---
The following code does not compile. But starts compiling once the first line
of function noCall is commented out and the next two line which are logically
equivalent are uncommented.

It seems compile time parameters of type bool are not propagated well by
symbols in certain situations.

struct Foo (bool S, bool L) {
  auto noCall() {
    Foo!(S, false) x;        // compiles if this line commented
    // static if(S) Foo!(true, false) x;
    // else         Foo!(false, false) x;
  }
  this (T) (T other)        // constructor
  if (is (T unused == Foo!(P, Q), bool P, bool Q)) { }
}

void main() {
  Foo!(false, true) k = Foo!(false, false)();
}

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