Skip to content

Commit

Permalink
Merge pull request #3628 from 9rnsr/fix10895
Browse files Browse the repository at this point in the history
Issue 10895 - incorrect std.array.join behavior with array of string-like class using alias this
  • Loading branch information
9rnsr committed Sep 3, 2015
2 parents 531d986 + 8e11f0e commit 13d9dbd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions std/array.d
Expand Up @@ -1689,6 +1689,20 @@ ElementEncodingType!(ElementType!RoR)[] join(RoR, E)(RoR ror, E sep)
}
}

unittest // Issue 10895
{
class A
{
string name;
alias name this;
this(string name) { this.name = name; }
}
auto a = [new A(`foo`)];
assert(a[0].length == 3);
auto temp = join(a, " ");
assert(a[0].length == 3);
}

unittest // Issue 14230
{
string[] ary = ["","aa","bb","cc"];
Expand Down

0 comments on commit 13d9dbd

Please sign in to comment.