Skip to content

prod(()) shouldn't return 1 #55675

Open
Open
@jariji

Description

@jariji
julia> prod(())
1

julia> prod([])
ERROR: MethodError: no method matching one(::Type{Any})

For () it's guessing that the output type is Int, which is bad. I think this should throw an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    foldsum, maximum, reduce, foldl, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions