Skip to content

Fixed length array type with negative count is accepted #15917

Closed
@lilyball

Description

@lilyball

A fixed length array type is allowed to be declared with a negative count. This is interpreted as the uint that would result from coercion, so on a 64-bit machine, [uint, ..-1] is considered the same as [uint, ..18446744073709551615].

This should probably be a compiler error, as negative counts don't make sense. Negative repeat counts in array expressions are already disallowed (as of #6985).

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