Enumerable#sum(&)
fails with certain block arguments
#15317
Labels
kind:bug
A bug in the code. Does not apply to documentation, specs, etc.
status:discussion
topic:stdlib:collection
Bug Report
Enumerable.sum(&)
should succeed as long as the block argument transforms the elements into values into types that supports addition. This pattern would be common when summing heterogeneous enumerables such as arrays and tuples. However, it fails in the following code snippet.Expected output:
ab
(similar to the output ofd.join
)Actual output:
Crystal version: 1.14.0
The text was updated successfully, but these errors were encountered: