Closed Alphaharrius closed 8 months ago
Checked there are only one location that have such issue, which is one of the constructor of the new Subset
which uses T::Type = iter|>first|>typeof
to evaluate the type of the iterator's elements. It is now changed to getting from the generated ordering
dictionary.
Other locations that have similar approach are all fetching information from function-scoped non-lazy iterators.
Description
Since Julia does not provide a good implementation of
eltype
which only return the typeT
of theArray{T}
, if somehow Julia evaluatedT
asAny
, theeltype
will returnAny
. Thus we have usediter|>first|>typeof
to check for the element type in a given iterator as a workaround. Yet this is shown to be faulty if the given iterating the given iterator is stateful, such as iterator type ofIterators.Stateful
or the iterator is a generator which invoke generating functions that mutate some states.Guidlines
Please locate all functions that uses
iter|>first|>...
to extract iterator element information across the entire codebase and change to other ways that does not implicitly induce state change.