Skip to content

Support negative indexes in Array #461

@gavv

Description

@gavv

Support negative indexes in:

  • Array.Value
  • Array.HasValue
  • Array.NotHasValue

Semantics should be the same as in Python. This feature is useful when you want to check boundary values in the array beginning and end. It becomes especially useful with deprecation of First and Last methods.

Bound checks in corresponding methods should be updated. Currently we check and report AssertInRange with Min = 0, Max = len-1. Now it would be convenient to report this range only if index is >= 0, and to check and report Min = -len, Max = -1 range if index is negative.

Unit tests and documentation comments for all 3 methods should be updated as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requesthelp wantedContributions are welcome

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions