[dmd-beta] dmd 1.058 and 2.043 beta

Don Clugston dclugston at googlemail.com
Wed Apr 7 14:15:19 PDT 2010


>> (2) I'm working on tracking down the Phobos unittest stack overflow.
>> It seems to be a regression. I've cut it down to this test case:
>> ---
>> import std.variant;
>> import std.typecons;
>>
>> alias Tuple!(Variant) crash;
>> ---
>> There have been no relevant changes to Phobos. I'm still working on it.
>
> It compiled in DMD svn 421, and fails in svn 423. It's caused by the
> ".init property for static arrays is now an array literal." change.

Here's the problem:

conv.d,  line 260:
/**
For structs that do not define $(D toString), the conversion to string
produces the list of fields.
 */
T to(T, S)(S s, in T left = S.stringof~"(", in T separator = ", ",
        in T right = ")")
if (is(S == struct) && isSomeString!(T) && !is(typeof(&S.init.toString)))
{
    Tuple!(FieldTypeTuple!(S)) * t = void;     // < ---------- Creates a Tuple
----------
and Tuple contains toString, defined in typecons.d line 435:

    string toString()
    {
        char[] result;
        auto app = appender(&result);
        app.put(toStringHeader);
        foreach (i, Unused; noStrings!(T).Result)
        {
            static if (i > 0) result ~= toStringSeparator;
            static if (is(typeof(to!string(field[i]))))
<------------ this is calls to!()
                app.put(to!string(field[i]));
------------

And that's all I have time for. I think this should fixed before the
release goes out -- it's a pretty nasty regression.


More information about the dmd-beta mailing list