-
-
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 typeintersect
bug reported in #36443
#46446
Commits on Sep 1, 2022
-
Avoid setting
offset
when we intersectVararg
's eltype.`var->offset` is used to recode the length difference of 2 `Vararg`s. But `Vararg`'s length might also be used in the type field, e.g. `Tuple{Vararg{Val{N}, N}} where {N}`, where we should ignore `offset` when we intersect `Val{N}`. This commit move the offset setting/erasing into `intersect_varargs`.
Configuration menu - View commit details
-
Copy full SHA for 01a4a30 - Browse repository at this point
Copy the full SHA 01a4a30View commit details -
Skip subtype check if
intersect_invariant
callsset_vat_to_const
.Co-Authored-By: Jameson Nash <vtjnash+github@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for e6d2624 - Browse repository at this point
Copy the full SHA e6d2624View commit details -
Configuration menu - View commit details
-
Copy full SHA for f29a013 - Browse repository at this point
Copy the full SHA f29a013View commit details -
Always return the shorter
Vararg
length.The type `var` might be switched during intersection. Thus previous result looks order dependent. When we intersect 2 `Vararg`s' length, we should always return the shorter one. As we has consumed the extra elements in `intersect_tuple`. Also fix JuliaLang#37257 Co-Authored-By: Jameson Nash <vtjnash+github@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 38829a0 - Browse repository at this point
Copy the full SHA 38829a0View commit details -
Avoid set
var
's bounds ifoffset != 0
if `offset != 0`, then these 2 var should have different value, thus it's invalid to set bounds.
Configuration menu - View commit details
-
Copy full SHA for b7f47d5 - Browse repository at this point
Copy the full SHA b7f47d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for a6a5f00 - Browse repository at this point
Copy the full SHA a6a5f00View commit details -
Make
bound_var_below
returnNULL
if the input typevar is not valid.If offset > 0, the correct result is `var - offset` if expressible. So an unbounded typevar should not be returned in this case as it might be a diagonal var. Since the result could be improved if `N` get fixed, set `intvalued` to 2 as a re-intersection hint.
Configuration menu - View commit details
-
Copy full SHA for 1268582 - Browse repository at this point
Copy the full SHA 1268582View commit details -
Avoid set var's lb if intersect return a Vararg with free length. (Nu…
…ll or a local type var) But `check_unsat_bound` should not be skipped. Co-Authored-By: Jameson Nash <vtjnash+github@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 2abedf6 - Browse repository at this point
Copy the full SHA 2abedf6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4654cfa - Browse repository at this point
Copy the full SHA 4654cfaView commit details