strings: type assert in the generic nextind, prevind methods#57608
Merged
fingolfin merged 6 commits intoJuliaLang:masterfrom Mar 3, 2025
Merged
strings: type assert in the generic nextind, prevind methods#57608fingolfin merged 6 commits intoJuliaLang:masterfrom
nextind, prevind methods#57608fingolfin merged 6 commits intoJuliaLang:masterfrom
Conversation
Member
Author
|
Decreases the number of invalidations on loading the following code from 1996 to 1472: struct I <: Integer end
Base.Int(::I) = 7 |
009b773 to
6b0037f
Compare
Contributor
|
But why are these assertions needed in the first place, the method signature already fixed these them to be Int, seems weird |
The type assertions are valid according to the doc strings of these two functions in the case of `AbstractString`. Should prevent some invalidation of user code. Fixes JuliaLang#57605
Maybe it prevents more invalidation.
5ce1cc4 to
7b174df
Compare
Member
Author
For good return type inference, we only needed the assertion on The current PR removes even the type assertion on |
Int in the generic nextind, prevind methodsnextind, prevind methods
fingolfin
approved these changes
Mar 3, 2025
KristofferC
pushed a commit
that referenced
this pull request
Mar 4, 2025
KristofferC
pushed a commit
that referenced
this pull request
Mar 11, 2025
KristofferC
pushed a commit
that referenced
this pull request
Mar 11, 2025
KristofferC
pushed a commit
that referenced
this pull request
Mar 25, 2025
KristofferC
pushed a commit
that referenced
this pull request
Mar 31, 2025
KristofferC
pushed a commit
that referenced
this pull request
Mar 31, 2025
KristofferC
pushed a commit
that referenced
this pull request
Jun 5, 2025
KristofferC
pushed a commit
that referenced
this pull request
Jul 3, 2025
71 tasks
Merged
Merged
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The type assertions are valid according to the doc strings of these functions in the case of
AbstractString.Should prevent some invalidation on loading user code.
Fixes #57605