From 8e11f0ebe23d2fab92bf979595729a5b2038055e Mon Sep 17 00:00:00 2001 From: k-hara Date: Thu, 3 Sep 2015 17:54:40 +0900 Subject: [PATCH] fix Issue 10895 - incorrect std.array.join behavior with array of string-like class using alias this --- std/array.d | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/std/array.d b/std/array.d index fb5dfecbc87..e165a226aa4 100644 --- a/std/array.d +++ b/std/array.d @@ -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"];