Skip to content

Commit

Permalink
Fix typo in error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
rvprasad committed Dec 27, 2024
1 parent e39b483 commit 6b4eea8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions spec/std/enumerable_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -1373,9 +1373,9 @@ describe "Enumerable" do
require "prelude"
[1, 10000000000_u64].sum
CRYSTAL
"Enumerable#sum/product() does support Union types. Instead, " +
"Enumerable#sum and #product do not support Union types. Instead, " +
"use Enumerable#sum/product(initial) with an initial value of " +
"the expected type of the sum/product call."
"the expected type of the call."
end

it "uses additive_identity from type" do
Expand Down Expand Up @@ -1427,9 +1427,9 @@ describe "Enumerable" do
require "prelude"
[1, 10000000000_u64].product
CRYSTAL
"Enumerable#sum/product() does support Union types. Instead, " +
"Enumerable#sum and #product do not support Union types. Instead, " +
"use Enumerable#sum/product(initial) with an initial value of " +
"the expected type of the sum/product call."
"the expected type of the call."
end
end

Expand Down
4 changes: 2 additions & 2 deletions src/enumerable.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2299,9 +2299,9 @@ module Enumerable(T)
def self.first
{% if X.union? %}
{{
raise("Enumerable#sum/product() does support Union types. " +
raise("Enumerable#sum and #product do not support Union types. " +
"Instead, use Enumerable#sum/product(initial) with an " +
"initial value of the expected type of the sum/product call.")
"initial value of the expected type of the call.")
}}
{% else %}
X
Expand Down

0 comments on commit 6b4eea8

Please sign in to comment.