Make indexing by non-integers an error #633
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #630
Indexing by non-integers was deprecated in #226 in the year 2018 with v0.9 and removed in #579 in the year 2025 with v0.16. However, removal of the deprecation results in a
StackOverflow
as per #630.The immediate fix is to re-add the methods but have them result in an error providing guidance on how to modify the deprecated behavior.
In the longer term, the custom
Base.to_index
needs to be removed.Interpolations.jl/src/Interpolations.jl
Line 378 in 7a2d581
Consequently, we should also not use
to_indices
to process arguments when using the function calling interface. This change is significantly more involved and may result in further breakage. For example, it is not clear if the function calling interface should supportCartesianIndex
as an argument or not.The MWE in #630 now results in the following error.