-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fix invalidations in sort! from Static.jl #46491
Conversation
Another instance where it might be easier in the long run to annotate the function definition itself? lt(::Left, x::T, y::T)::Bool where {T<:Floats} = slt_int(y, x)
lt(::Right, x::T, y::T)::Bool where {T<:Floats} = slt_int(x, y) |
I'm not sure whether it works and fixes the invalidations but since you seem to be sure I did what you suggested in bbf1bde |
You can ensure that these fix invalidations in master by building from you branch of Julia and looking at the invalidations again. I didn't see invalidations when I added a |
There do not seem to be invalidations anymore on recent |
@Tokazama, inference stops checking whether all possible callees return |
That's really interesting because one of the ideas being thrown around to resolve invalidations more proactively by Stefan was to have some way of declaring all method variants inherit a type assertion (e.g., |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this calls isless
, this seems perfectly safe.
(cherry picked from commit 1fae1b9)
This should hopefully fix quite some invalidations coming from Static.jl.
Here is the code:
Since
!lt(...)
is used here in anif
stament - andif
statements only acceptBool
s -it appears to be sane to assert that
lt
returns aBool
here.See also #46481, #46490