Skip to content

Commit 748ea8a

Browse files
authored
Suggest each if map function returns void (#10887)
1 parent 5ae986d commit 748ea8a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

std/algorithm/iteration.d

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,8 @@ if (fun.length >= 1)
659659
foreach (f; _funs)
660660
{
661661
static assert(!is(typeof(f(RE.init)) == void),
662-
"Mapping function(s) must not return void: " ~ _funs.stringof);
662+
"Mapping function(s) must not return void. " ~
663+
" Consider using `each` instead of `map!(" ~ _funs.stringof ~ ")`");
663664
}
664665

665666
return MapResult!(_fun, Range)(r);

0 commit comments

Comments
 (0)