Skip to content

Commit

Permalink
Fix a typo in the error message
Browse files Browse the repository at this point in the history
  • Loading branch information
rvprasad committed Dec 28, 2024
1 parent a09f57b commit 2dd0012
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions spec/std/enumerable_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/enumerable.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}}
Expand Down

0 comments on commit 2dd0012

Please sign in to comment.