Skip to content

Commit

Permalink
Compiler error for Enumerable#sum on union type
Browse files Browse the repository at this point in the history
straight-shoota committed Dec 11, 2024

Verified

This commit was signed with the committer’s verified signature.
straight-shoota Johannes Müller
1 parent ed7dce3 commit d484246
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/enumerable.cr
Original file line number Diff line number Diff line change
@@ -2292,7 +2292,7 @@ module Enumerable(T)
# if the type is a union.
def self.first
{% if X.union? %}
{{X.union_types.first}}
{% raise "Cannot determine type" %}
{% else %}
X
{% end %}

0 comments on commit d484246

Please sign in to comment.