Mercurial > projects > ldc
view tests/mini/tupleval.d @ 1611:3f728445fc42
Merge DMD r277: bugzilla 3495 Segfault(typinf.c) instantiating D variadic...
bugzilla 3495 Segfault(typinf.c) instantiating D variadic function with
too few arguments.
---
dmd/expression.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
author | Leandro Lucarella <llucax@gmail.com> |
---|---|
date | Wed, 06 Jan 2010 15:18:21 -0300 |
parents | 8d850fa25713 |
children |
line wrap: on
line source
module foo; template ParameterTupleOf( Fn ) { static if( is( Fn Params == function ) ) alias Params ParameterTupleOf; else static if( is( Fn Params == delegate ) ) alias ParameterTupleOf!(Params) ParameterTupleOf; else static if( is( Fn Params == Params* ) ) alias ParameterTupleOf!(Params) ParameterTupleOf; else static assert( false, "Argument has no parameters." ); } struct S { int opApply(T)(T dg) { alias ParameterTupleOf!(T) U; U u; u[0] = 1; u[1] = 2; return 0; } } void main() { foreach(int x, int y; S()){} }