-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Regression: failure of TypeVar in recursive struct with NTuple
field
#55189
Labels
regression
Regression in behavior compared to a previous version
Comments
NTuple
fieldNTuple
field
This works on 1.6.7, so seems to be a regression: julia> struct A{N}
children::NTuple{N,A{N}}
end
julia> fieldtypes(A{2})
(Tuple{A{2}, A{2}},) On 1.7.3 it seems to infinitely hang. Possibly also caused by #43306? |
KristofferC
pushed a commit
that referenced
this issue
Aug 13, 2024
Comparing objects by `==` will happily answer nonsense for malformed type comparisons, such as `unwrap_unionall(A) == A`. Avoid forming that query. Additionally, need to recourse through Vararg when examining type structure to make decisions. Fix #55076 Fix #55189 (cherry picked from commit 32423a8)
lazarusA
pushed a commit
to lazarusA/julia
that referenced
this issue
Aug 17, 2024
Comparing objects by `==` will happily answer nonsense for malformed type comparisons, such as `unwrap_unionall(A) == A`. Avoid forming that query. Additionally, need to recourse through Vararg when examining type structure to make decisions. Fix JuliaLang#55076 Fix JuliaLang#55189
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using
NTuple
in a recursive type, there is a failure of TypeVars to apply:However, this should be
Tuple{A{2}, A{2}}
.Consider
NTuple
by itself:You can use this in structs if it is not recursive:
However, if the type is recursive, the typevar fails to apply in the type parameters.
versioninfo()
:Another potentially related failure for
NTuple
field types is #55076.While this fails on 1.10.4, this works on 1.6.7.
The text was updated successfully, but these errors were encountered: