Skip to content

sum with dims kwarg is incorrect on Any array when missings are present #55213

@cstjean

Description

@cstjean

On Julia 1.10.4

julia> sum(Any[0.0 1; 0.0 missing], dims=2)
2×1 Matrix{Missing}:
 missing
 missing

whereas

julia> sum([0.0 1; 0.0 missing], dims=2)
2×1 Matrix{Union{Missing, Float64}}:
 1.0
  missing

Metadata

Metadata

Assignees

No one assigned

    Labels

    correctness bug ⚠Bugs that are likely to lead to incorrect results in user code without throwingfoldsum, maximum, reduce, foldl, etc.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions