digitalmars.D.bugs - [Issue 2725] New: Pattern matching in static if not working with variadic arguments
- d-bugmail puremagic.com (27/27) Mar 10 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2725
- d-bugmail puremagic.com (7/7) Mar 13 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2725
- Derek Parnell (8/9) Mar 13 2009 BTW, this is the sort of thing that my "ASCII version of APL" was referr...
- d-bugmail puremagic.com (9/9) Apr 01 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2725
http://d.puremagic.com/issues/show_bug.cgi?id=2725 Summary: Pattern matching in static if not working with variadic arguments Product: D Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: andrei metalanguage.com struct A(B...) {} void main() { alias A!(int, float) X; static if (!is(X Y == A!(Z), Z)) { static assert(false); } } This example fails the static assert. If one removes the float in the instantiation of A the example compiles. The compiler should match Z to the type tuple (int, float). Otherwise it is impossible to detect whether a type is an instantiation of a variadic template. --
Mar 10 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2725 The is expression needs to be written as: static if (!is(X Y == A!(Z), Z...)) with the addition of the ... to indicate that Z is a tuple parameter. It still won't compile right, though, so I'll fix it. --
Mar 13 2009
On Fri, 13 Mar 2009 21:40:29 +0000 (UTC), d-bugmail puremagic.com wrote:static if (!is(X Y == A!(Z), Z...))BTW, this is the sort of thing that my "ASCII version of APL" was referring to. There is no 'intuitive' way to make any sense of that code phrase. I can't even workout how to say it out loud, as in translate it into English. -- Derek Parnell Melbourne, Australia skype: derek.j.parnell
Mar 13 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2725 bugzilla digitalmars.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED Fixed DMD 2.027 --
Apr 01 2009