Skip to content

Conversation

vtjnash
Copy link
Contributor

@vtjnash vtjnash commented Dec 4, 2023

The itr return type was assumed to be always the same as the first element. This is false for many objects, such as Tuple. Additionally, it was using a private API (Core.Compiler and
Core.Compiler.return_type) which are not stable across versions of Julia and may return weird and unpredictable answers. Switch to using the API in Base for this.

The `itr` return type was assumed to be always the same as the first
element. This is false for many objects, such as Tuple. Additionally,
it was using a private API (Core.Compiler and
Core.Compiler.return_type) which are not stable across versions of
Julia and may return weird and unpredictable answers. Switch to using
the API in Base for this.
@piever
Copy link
Collaborator

piever commented Dec 6, 2023

Thanks for the PR!

The itr return type was assumed to be always the same as the first element.

That part should be fine as we only really use that for empty iterables: the ::Nothing in the signature is the result of iterate(itr). Still it's true that we shouldn't rely on Base internals here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants