D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 14230 - [REG2.067b2] std.array.join misses the first element which is empty string
Summary: [REG2.067b2] std.array.join misses the first element which is empty string
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2015-02-28 02:45 UTC by jiki
Modified: 2017-07-19 17:42 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description jiki 2015-02-28 02:45:38 UTC
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
}
------------------------------------------------------
Comment 1 github-bugzilla 2015-02-28 21:03:20 UTC
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/43e56d57a51ef6a3240a459d3e6068fc4a9292a5
Fix Issue 14230 - std.array.join misses the first element which is empty string

https://github.com/D-Programming-Language/phobos/commit/b43a7b8b6095e19d93d479942c084e6f588adc3d
Merge pull request #3027 from sinkuu/fix_14230

Fix Issue 14230 - [REG2.067b2] std.array.join misses the first element which is empty string
Comment 2 github-bugzilla 2015-02-28 21:13:11 UTC
Commit pushed to 2.067 at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/b4fa59bd736c30c183039044fe48d7477a1cc615
Merge pull request #3027 from sinkuu/fix_14230

Fix Issue 14230 - [REG2.067b2] std.array.join misses the first element which is empty string
Comment 4 github-bugzilla 2015-04-11 12:24:52 UTC
Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/b4fa59bd736c30c183039044fe48d7477a1cc615
Merge pull request #3027 from sinkuu/fix_14230
Comment 5 github-bugzilla 2015-06-17 21:03:12 UTC
Commits pushed to stable at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/43e56d57a51ef6a3240a459d3e6068fc4a9292a5
Fix Issue 14230 - std.array.join misses the first element which is empty string

https://github.com/D-Programming-Language/phobos/commit/b43a7b8b6095e19d93d479942c084e6f588adc3d
Merge pull request #3027 from sinkuu/fix_14230
Comment 6 github-bugzilla 2017-07-19 17:42:17 UTC
Commits pushed to dmd-cxx at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/43e56d57a51ef6a3240a459d3e6068fc4a9292a5
Fix Issue 14230 - std.array.join misses the first element which is empty string

https://github.com/dlang/phobos/commit/b43a7b8b6095e19d93d479942c084e6f588adc3d
Merge pull request #3027 from sinkuu/fix_14230