-
-
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
inference: fix recursion limit heuristic #28517
Conversation
There's several related issues here: 1. Covariant kinds provide no meaningful information for the type size limit heuristic. We should be just ignoring those and walking through to the actual structural information of any real substance. This seems to also make type_more_complex, _limit_type_size, and is_derived_type more similar, which is probably always preferable. 2. Allowing type intersection to revise our type later can cause it to reintroduce complexity (constraints) according to our metric, while we want to only move up the type-hierarchy, which can allow us to accidentally escape from the limit. So if we've limited the type, we don't want to use a different type that was derived by type-intersection and may not have our limits applied anymore. 3. Inside `is_derived_type`, the var field of a UnionAll should not increase the nesting depth, since `T<:(Ref{S} where S<:Any)`, should observe the same depth as `{S<:Any, T<:Ref{S}}`. fix #26665
Thanks! Will there be another release candidate for 0.7? If so, could this be backported? |
No, the final 0.7.0 has already been tagged. |
Obvious next question: Will there be 1.0-rc2? |
No, but this will go into 1.0 final. |
If you end up needing a version of 0.7 (to get deprecation warnings) that has this bug fix, we can release a 0.7.1 at some point. |
Indeed, I was thinking about the deprecation warnings. Thanks. |
PkgEval shows the same set of packages passing as on master. Merging. |
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.
approve
Thanks again for fixing this Jameson. |
There's several related issues here:
Covariant kinds provide no meaningful information for the type size
limit heuristic. We should be just ignoring those and walking through to
the actual structural information of any real substance.
This seems to also make type_more_complex, _limit_type_size, and
is_derived_type more similar, which is probably always preferable.
Allowing type intersection to revise our type later can
cause it to reintroduce complexity (constraints) according to our metric,
while we want to only move up the type-hierarchy,
which can allow us to accidentally escape from the limit.
So if we've limited the type, we don't want to use a different type
that was derived by type-intersection and may not have our limits
applied anymore.
Inside
is_derived_type
, the var field of a UnionAllshould not increase the nesting depth, since
T<:(Ref{S} where S<:Any)
,should observe the same depth as
{S<:Any, T<:Ref{S}}
.fix #26665