-
-
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
0.5: Type too large error #15464
Comments
This appears to be fixed (at least in the development branch). |
Would be great to get a reduced test case if at all possible, so we can make sure it stays fixed. |
The original bug was only triggered when running all tests in a row: running even just the line in question wasn't sufficient. So I'm not sure a reduced test case is realistic. I didn't check whether the bug is indeed fixed on the branch above. But new deprecations would make that time consuming. |
The test failure was fixed by e529058 But the bug is a tvar construction error, which results in roughly trying to compute the following intersection: julia> type RealBasis end; type IntervalDomain end; type SumSpace{a,b,c,d} end;
julia> a=Tuple{typeof(==), Type{TypeVar(:_, SumSpace)}, Type{TypeVar(:_, SumSpace{TypeVar(:_, TypeVar(:SV, Any)), RealBasis, TypeVar(:DD, IntervalDomain, true), 1})}}
ERROR: TypeError: typeassert: expected Type{T}, got TypeVar
julia> b=Tuple{typeof(==), Type{TypeVar(:T, true)}, Type{TypeVar(:T, true)}}
julia> typeintersect(a,b)
ERROR: type too large AFAICT, there's only one place in the code where this type could have been constructed, requiring the following patch to fix this issue: diff --git a/src/jltypes.c b/src/jltypes.c
index 95460b2..33c3f69 100644
--- a/src/jltypes.c
+++ b/src/jltypes.c
@@ -796,7 +796,7 @@ static jl_value_t *approxify_type(jl_datatype_t *dt, jl_svec_t *pp)
JL_GC_PUSH1(&p);
for(i=0; i < l; i++) {
jl_value_t *el = jl_svecref(dt->parameters, i);
- if (jl_has_typevars_from(el, pp))
+ if (!jl_is_typevar(el) && jl_has_typevars_from(el, pp))
jl_svecset(p, i, jl_new_typevar(underscore_sym, jl_bottom_type, el));
else
jl_svecset(p, i, el); @JeffBezanson @carnaval do you know how to trigger this directly to make a test? |
bump. @JeffBezanson can you write a test for this? |
bump again. |
@dlfivefifty Worth trying this again now that #18457 is merged. Will be very interesting to see what happens. The |
@JeffBezanson the branch that triggered the bug won't work in 0.6, so I won't be able to test it, unfortunately. |
Seems to be fixed for practical purposes, and current subtype and intersection issues are tracked elsewhere. |
I'm trying to get ApproxFun working in 0.5, but the tests fail due to a "type too large" error, see error dump below. This only occurs when I run all the tests at once: if I run just the line that throughs the error:
I don't get the error message, though the compile time seems very long compared to 0.4.
You can reproduce it with:
My
versioninfo
isHere is the error dump:
The text was updated successfully, but these errors were encountered: