Skip to content

Trying to construct a nonempty <:Array{Union{}} should throw #53002

Closed as not planned
@nsajko

Description

@nsajko
julia> Vector{Union{}}(undef, 1)
1-element Vector{Union{}}:
 #undef

Two issues:

  1. an array of type <:AbstractArray{Union{}} must always be empty (because Union{} never has instances). So why is the object being show-n as "1-element Vector{Union{}}"?

  2. Given that <:AbstractArray{Union{}} can never have elements (or, more precisely I guess, iterate will either return nothing or throw), trying to construct such an array with a nonzero length should throw.

The example above is by @tpapp in #52385 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingThis change will break codecollectionsData structures holding multiple items, e.g. sets

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions