Skip to content

Commit

Permalink
fix Issue 10895 - incorrect std.array.join behavior with array of str…
Browse files Browse the repository at this point in the history
…ing-like class using alias this
  • Loading branch information
9rnsr committed Sep 3, 2015
1 parent 531d986 commit 8e11f0e
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 8e11f0e

Please sign in to comment.