On Sunday, 10 September 2017 at 16:25:52 UTC, jmh530 wrote:
The following code compiles on DMD, but not on LDC (tested versions 1.3.0 and the 1.4.0 beta).

unittest
{
    import std.array : appender;
    import std.format : formattedWrite;

    auto x = appender!(string);
    typeof(x) y;

    formattedWrite(y, "%2s", [0, 1]);
    assert(y.data == "[ 0,  1]");
}

There's a difference between "doesn't compile" and "asserts".
Please always compare to the matching DMD version, 2.074.1 in this case, which produces an empty string as well, I guess because the writer was taken by value in Phobos 2.074.1.

Reply via email to