Skip to content

Enum should be a scalar for broadcast #30669

@stevengj

Description

@stevengj

It seems like we need a definition

broadcastable(x::Enum) = Ref(x)

like the ones here.

Pointed out recently on discourse.

This won't break backwards compatibility, because currently broadcasting over an enum gives MethodError: no method matching length(::Foo).

Metadata

Metadata

Assignees

No one assigned

    Labels

    broadcastApplying a function over a collectiongood first issueIndicates a good issue for first-time contributors to Julia

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions