diff --git a/spec/std/enumerable_spec.cr b/spec/std/enumerable_spec.cr index 5c66ddf55062..09d89ddcdf6d 100644 --- a/spec/std/enumerable_spec.cr +++ b/spec/std/enumerable_spec.cr @@ -1374,8 +1374,8 @@ describe "Enumerable" do [1, 10000000000_u64].sum CRYSTAL "Enumerable#sum() and #product() do not support Union types. " + - "Instead, use Enumerable#sum and #product(initial), respectively, " + - "with an initial value of the intended type of the call." + "Instead, use Enumerable#sum(initial) and #product(initial), " + + "respectively, with an initial value of the intended type of the call." end it "uses additive_identity from type" do @@ -1428,8 +1428,8 @@ describe "Enumerable" do [1, 10000000000_u64].product CRYSTAL "Enumerable#sum() and #product() do not support Union types. " + - "Instead, use Enumerable#sum and #product(initial), respectively, " + - "with an initial value of the intended type of the call." + "Instead, use Enumerable#sum(initial) and #product(initial), " + + "respectively, with an initial value of the intended type of the call." end end diff --git a/src/enumerable.cr b/src/enumerable.cr index fb78d5c569ce..0e87867b28dd 100644 --- a/src/enumerable.cr +++ b/src/enumerable.cr @@ -2300,7 +2300,7 @@ module Enumerable(T) {% if X.union? %} {{ raise("Enumerable#sum() and #product() do not support Union types. " + - "Instead, use Enumerable#sum and #product(initial), " + + "Instead, use Enumerable#sum(initial) and #product(initial), " + "respectively, with an initial value of the intended type " + "of the call.") }}