-
-
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
Wrong Vararg
expansion in type intersection
#37257
Labels
types and dispatch
Types, subtyping and method dispatch
Comments
N5N3
added a commit
to N5N3/julia
that referenced
this issue
Aug 23, 2022
The type `var` might be switched during intersection. Thus previous result looks order dependent. In fact, we should always return the shorter `Vararg` length. As former terms has been taken care by `intersect_tuple`. Also fix JuliaLang#37257
N5N3
added a commit
to N5N3/julia
that referenced
this issue
Aug 23, 2022
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
N5N3
added a commit
to N5N3/julia
that referenced
this issue
Aug 23, 2022
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
N5N3
added a commit
to N5N3/julia
that referenced
this issue
Aug 24, 2022
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
N5N3
added a commit
to N5N3/julia
that referenced
this issue
Aug 24, 2022
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
N5N3
added a commit
to N5N3/julia
that referenced
this issue
Aug 24, 2022
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
N5N3
added a commit
to N5N3/julia
that referenced
this issue
Aug 24, 2022
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
N5N3
added a commit
to N5N3/julia
that referenced
this issue
Aug 24, 2022
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
N5N3
added a commit
to N5N3/julia
that referenced
this issue
Aug 24, 2022
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
N5N3
added a commit
to N5N3/julia
that referenced
this issue
Aug 29, 2022
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
N5N3
added a commit
to N5N3/julia
that referenced
this issue
Aug 31, 2022
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>
N5N3
added a commit
to N5N3/julia
that referenced
this issue
Aug 31, 2022
N5N3
added a commit
to N5N3/julia
that referenced
this issue
Sep 1, 2022
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>
N5N3
added a commit
to N5N3/julia
that referenced
this issue
Sep 1, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Clearly, the result should be
Tuple{Val{1},Any,Any,Any}
in all three cases.Of course, this can have an impact on inference, e.g.
Note that in the bad case, not only is inference of the first return value needlessly imprecise (because
N
wasn't fixed), but the type of the second return value is plain wrong.I've stumbled upon this when looking at suboptimal inference of this constructor:
julia/base/bitarray.jl
Line 28 in 4b42f14
So this is not a purely theoretical issue.
The text was updated successfully, but these errors were encountered: