[Issue 1944] New: is-expressions don't correctly define tuples named in the match expression

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 25 14:34:23 PDT 2008


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

           Summary: is-expressions don't correctly define tuples named in
                    the match expression
           Product: D
           Version: 2.012
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: webmaster at villagersonline.com


dmd 2.012

The following code should compile just fine.  Instead, the 2nd static assert()
fails.

BEGIN CODE
  template foo(TPL...)
  {
    static if( is(typeof(&TPL[0]) Tignored1 == void function(T), T) )
      static assert(is(T == int));

    static if( is(typeof(&TPL[0]) Tignored2 == void function(ARGS), ARGS...) )
      static assert(ARGS.length > 0);
  }

  void bar(int i) {};
  alias foo!(bar) baz;
END CODE


-- 



More information about the Digitalmars-d-bugs mailing list