-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
strings: type assert in the generic nextind, prevind methods
#57608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strings: type assert in the generic nextind, prevind methods
#57608
Conversation
|
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
|
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
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
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