diff --git a/std/range.d b/std/range.d index 5fd71af45..591cb48d9 100644 --- a/std/range.d +++ b/std/range.d @@ -2019,7 +2019,9 @@ assert(equal(s, [1, 2, 3, 4, 5, 6, 7][])); ---- */ auto chain(Ranges...)(Ranges rs) -if (Ranges.length > 0 && allSatisfy!(isInputRange, staticMap!(Unqual, Ranges))) +if (Ranges.length > 0 && + allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)) && + !is(CommonType!(staticMap!(ElementType, staticMap!(Unqual, Ranges))) == void)) { static if (Ranges.length == 1) {