[Issue 14230] New: [REG2.067b2] std.array.join misses the first element which is empty string

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Feb 27 18:45:38 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14230

          Issue ID: 14230
           Summary: [REG2.067b2] std.array.join misses the first element
                    which is empty string
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: regression
          Priority: P1
         Component: Phobos
          Assignee: nobody at puremagic.com
          Reporter: jiki at red.email.ne.jp

I sometimes use join() in this way.

join( [""] ~ ["aa","bb","cc"], " @" )
 --> " @aa @bb @cc"

This doesn't work properly in D2.
This is a regression, probably.

------------------------------------------------------
import std.stdio;
import std.array;

void main()
{
    string[] ary = ["","aa","bb","cc"]; // leaded by _empty_ element
    writeln(ary.join(" @"));
        // In 2.067b2, this outputs "aa @bb @cc" or asserts inside of join()

    assert(ary.join(" @") == " @aa @bb @cc"); // OK in 2.067b1 and olders
}
------------------------------------------------------

--


More information about the Digitalmars-d-bugs mailing list