-
-
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
Crash in type inference #36407
Comments
It's this assertion that is triggered: julia/base/compiler/typelimits.jl Line 23 in 6cd329c
(And then it errors because it can't format it's message, which is unfortunate, because it makes it a bit harder to pinpoint the problem.) The situation that leads to the assertion being triggered is this: julia> t = Tuple{typeof(Hecke.ideal), Hecke.NfRelOrd{T, S, U}, U, U, S, S, Bool} where U where S<:(Hecke.NfRelOrdIdl{T, S, U} where U where S where T) where T
Tuple{typeof(ideal),Hecke.NfRelOrd{T,S,U},U,U,S,S,Bool} where U where S<:(Hecke.NfRelOrdIdl{T,S,U} where U where S where T) where T
julia> compare = Tuple{typeof(Hecke.ideal), Hecke.NfRelOrd{T, S, U}, U, U, S, S, Bool} where U where S where T
Tuple{typeof(ideal),Hecke.NfRelOrd{T,S,U},U,U,S,S,Bool} where U where S where T
julia> source = Core.svec() # more complicated in reality, but irrelevant
svec()
julia> r = Core.Compiler._limit_type_size(t, compare, source, 1, 8)
Tuple{typeof(ideal),Hecke.NfRelOrd,U,U,Hecke.NfRelOrdIdl,Hecke.NfRelOrdIdl,Bool} where U
julia> t <: r
false The problem here is that |
I'm not certain if this is fixable without #24614 |
In this case, In the meantime, maybe we could replace the assertion with some fallback that widens even more aggressively. |
While the condition (the new type has to be wider) of the assertation should hold, #36407 shows that this may still fail sometimes. Instead of throwing an error, it seems better to just widen more aggressively if needed to ensure that the condition is fulfilled.
While the condition (the new type has to be wider) of the assertion should hold, #36407 shows that this may still fail sometimes. Instead of throwing an error, it seems better to just widen more aggressively if needed to ensure that the condition is fulfilled.
While the condition (the new type has to be wider) of the assertion should hold, #36407 shows that this may still fail sometimes. Instead of throwing an error, it seems better to just widen more aggressively if needed to ensure that the condition is fulfilled.
While the condition (the new type has to be wider) of the assertion should hold, JuliaLang#36407 shows that this may still fail sometimes. Instead of throwing an error, it seems better to just widen more aggressively if needed to ensure that the condition is fulfilled.
I had a similar type error as the one reported here. For me, it was solved by switching from Julia 1.5.3 to 1.6. |
We have run into an error in the Julia type inference (see oscar-system/Oscar.jl#104 for the original issue, for which we since implemented a workaround in oscar-system/Oscar.jl#110). The issue happens in Julia 1.4.2 and also 1.5, but was fixed "by accident" (?) on the Julia master branch by PR #36200
To reproduce this, install
Oscar
but in a revision before the fix. So:Then there are several ways to trigger an issue. For example, this input
results in this:
and then
Or run the full test suite:
The text was updated successfully, but these errors were encountered: