-
-
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
StackOverflow error using tuple types as type parameter #22239
Comments
fix #22239, stack overflow in type intersection
The above example now indeed works on 0.6.0 - thanks! - but unfortunately after more tests the code that led to this issue still produces a similar error. The minimal working example is now more complicated:
I can't reduce this any further without making the problem go away. In particular, the second argument seems important, as well as the nested tuple. The exact error message is the same StackOverflowError:
Version info (0.6.0 as released):
|
Here is another example that is less nested but produces a similar error:
|
julia> typeintersect(Tuple{Type{Tuple{T,Val{T}}}, Val{T}} where T, Tuple{Type{Tuple{Val{T},T}}, Val{T}} where T)
ERROR: StackOverflowError:
Stacktrace:
[1] typeintersect(::Any, ::Any) at ./reflection.jl:314 |
The following code produces a StackOverflowError on 0.6 RC2:
Output when running
julia foo.jl
with the above two lines as contents:Yet, everything works fine if the order of the two lines is reversed!
Val
above, i.e. the tuple types have to be type parameters. Maybe that is not a valid thing to do? The above is a MWE, the context was code to convert between nested tuples and flat tuples.T=Int
, but that is not essential. You can replace theInt
withTuple{T,T}
so it never matches the first line, and the problem remains.Version info:
The text was updated successfully, but these errors were encountered: