Skip to content

Inference failure in maximum / minimum #43461

Closed
@mcabbott

Description

@mcabbott

Should this be able to infer the type?

julia> @inferred maximum([1 2; 3 4]; dims=1)
ERROR: return type Matrix{Int64} does not match inferred return type Union{Matrix{Float64}, Matrix{Int64}}

The instability is in Base.reducedim_init(identity, max, [1 2; 3 4], 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions