Skip to content

range(0, length=Uint(0)) throws InexactError #35711

@ethomag

Description

@ethomag
julia> range(0, length=UInt(0))
ERROR: InexactError: check_top_bit(Int64, 18446744073709551615)

Due to the fact that empty ranges are represented by n:n-1, which breaks with n=0 and unsigned types.

I think the range expression is a valid one that ought to be supported and the error message is not very helpful.

Could not find anything related on discourse, the closest one is:
#26608

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