Closed
Description
sum for tuples uses +
which has the following two consequences:
- when a 1-element collection is passed
+
errors, while standardsum
silently accepts the value:
julia> sum(["a"])
"a"
julia> sum(("a",))
ERROR: MethodError: no method matching +(::String)
- no promotion happens (as standard
sum
usesadd_sum
):
julia> sum([0xe1, 0x1f])
0x0000000000000100
julia> sum((0xe1, 0x1f))
0x00