-
-
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
Expand more Vararg elements during re-intersection if valid. #46604
Merged
Conversation
This file contains 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
N5N3
force-pushed
the
Vararg_expansion2
branch
from
September 2, 2022 16:38
3f61194
to
5858740
Compare
N5N3
changed the title
Expend more Vararg elements during re-intersection if valid.
Expand more Vararg elements during re-intersection if valid.
Sep 2, 2022
N5N3
force-pushed
the
Vararg_expansion2
branch
3 times, most recently
from
September 3, 2022 06:24
a1e0565
to
2d682f7
Compare
vtjnash
force-pushed
the
Vararg_expansion2
branch
from
September 28, 2022 07:13
2d682f7
to
6b84913
Compare
vtjnash
approved these changes
Sep 28, 2022
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.
Seems reasonable to me. But maybe Jeff should take a look too?
N5N3
force-pushed
the
Vararg_expansion2
branch
from
October 7, 2022 07:07
6b84913
to
235d7fa
Compare
vtjnash
force-pushed
the
Vararg_expansion2
branch
from
December 14, 2022 16:51
235d7fa
to
fb07cd9
Compare
vtjnash
added
the
needs pkgeval
Tests for all registered packages should be run with this change
label
Dec 14, 2022
This should be valid if the type var is used only for `Vararg` length. This commit add a new field `max_offset` to our type env. which is used to tracks the minimum length of a `Vararg` during the 1st round intersection. (It's value would be set to `-1` if this var has other usage.) If we got a positive value, then we can expand more elements during the 2nd round intersection safely. With these extra elements, the offset between 2 `Vararg`s will reduce to 0 (hopefully), and thus we get a more accurate result.
N5N3
force-pushed
the
Vararg_expansion2
branch
from
December 13, 2023 15:34
fb07cd9
to
a80fc02
Compare
@nanosoldier |
vtjnash
added
merge me
PR is reviewed. Merge when all tests are passing
and removed
needs pkgeval
Tests for all registered packages should be run with this change
labels
Dec 13, 2023
The package evaluation job you requested has completed - possible new issues were detected. |
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.
At present, out typeintersection "prefers"
Tuple
with more parameters.This PR tries to replace
Tuple{Vararg{T,N}}
withTuple{T,T,T,Vararg{T,N}}
during re-intersection if we can prove thatN >= 3
andN
is used only for Vararg length.It is somewhat similar to #39098 but only fucus on the expansion.
Resolve some intersection regression and this TODO from #46446.
https://github.com/JuliaLang/julia/pull/46446/files#diff-5565c704be02f2d46527b6f2f72a2c138c06d703a18e34316b6ec52b17a94bd4R2112-R2113