Skip to content

Conversation

nsajko
Copy link
Member

@nsajko nsajko commented Sep 13, 2025

  • Allow non-Int in dispatch for the second argument (iteration state), but typeassert Int in the method body. This improves abstract inference because the compiler can know the second argument must be Int to avoid a throw, when previously such a call would have dispatched to the generic method.

  • Base.rest: unify the methods for Array and SimpleVector, also adding in Memory.

  • Base.indexed_iterate: add Memory to the method for Array, as with Base.rest.

* Allow non-`Int` in dispatch for the second argument (iteration
  state), but `typeassert` `Int` in the method body. This improves
  abstract inference because the compiler can know the second argument
  must be `Int` to avoid a throw, when previously such a call would
  have dispatched to the generic method.

* `Base.rest`: unify the methods for `Array` and `SimpleVector`, also
  adding in `Memory`.

* `Base.indexed_iterate`: add `Memory` to the method for `Array`, as
  with `Base.rest`.
@nsajko nsajko added arrays [a, r, r, a, y, s] iteration Involves iteration or the iteration protocol labels Sep 13, 2025
@nsajko nsajko marked this pull request as ready for review September 13, 2025 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s] iteration Involves iteration or the iteration protocol
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants