A tuple bug?
Jari-Matti Mäkelä
jmjmak at utu.fi.invalid
Mon Apr 23 13:42:37 PDT 2007
Max Samukha wrote:
> The output when compiling the code below is "1, 1" while it should be
> "1, 2". When 'names' declarations are commented out, the output is
> correct.
<snip>
> Is it a bug?
Yeah, something fishy is happening here (tested with dmd 1.013). This code
template Foo(A...)
{
const char[] values = A[1].stringof;
pragma(msg, A.length.stringof); // 1)
pragma(msg, values);
}
void main()
{
alias Foo!(1,1,1,1,1) val;
}
returns
5
5
but commenting the line 1) makes it return '1'. Also the compiler should
be able to infer the type of 'values' when 'char[]' is omitted, but it
doesn't. So, at least two bugs here.
More information about the Digitalmars-d-learn
mailing list