# HG changeset patch # User thomask # Date 1165769387 0 # Node ID 27780213cb6d48a430b0b659fe1750f89682be44 # Parent cfe776588fc0c956efca949b9679ed0e4f548491 [Issue 664] New: is(func T == return) ignores variadic arguments Thomas K?hne 2006-12-09 news:bug-664-3@http.d.puremagic.com/issues/ diff -r cfe776588fc0 -r 27780213cb6d compile/i/is_16_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/i/is_16_A.d Sun Dec 10 16:49:47 2006 +0000 @@ -0,0 +1,23 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Thomas Kühne +// @date@ 2006-12-09 +// @uri@ news:bug-664-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 664] New: is(func T == return) ignores variadic arguments + +module dstress.compile.i.is_16_A; + +void foo(int); +void bar(int, ...); + +static if(is(typeof(foo) X == function)){ + static if(is(typeof(bar) Y == function)){ + static assert(X.length != Y.length); + }else{ + static assert(0); + } +}else{ + static assert(0); +} diff -r cfe776588fc0 -r 27780213cb6d compile/i/is_16_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/i/is_16_B.d Sun Dec 10 16:49:47 2006 +0000 @@ -0,0 +1,23 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Thomas Kühne +// @date@ 2006-12-09 +// @uri@ news:bug-664-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 664] New: is(func T == return) ignores variadic arguments + +module dstress.compile.i.is_16_B; + +void foo(int); +void bar(int ...); + +static if(is(typeof(foo) X == function)){ + static if(is(typeof(bar) Y == function)){ + static assert((X.length != Y.length) || (!is(X[0] == Y[0]))); + }else{ + static assert(0); + } +}else{ + static assert(0); +} diff -r cfe776588fc0 -r 27780213cb6d compile/i/is_16_C.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/i/is_16_C.d Sun Dec 10 16:49:47 2006 +0000 @@ -0,0 +1,23 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Thomas Kühne +// @date@ 2006-12-09 +// @uri@ news:bug-664-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 664] New: is(func T == return) ignores variadic arguments + +module dstress.compile.i.is_16_C; + +void foo(int, ...); +void bar(int ...); + +static if(is(typeof(foo) X == function)){ + static if(is(typeof(bar) Y == function)){ + static assert((X.length != Y.length) || (!is(X[$-1] == Y[$-1]))); + }else{ + static assert(0); + } +}else{ + static assert(0); +}