-
-
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
A*v with A SymTridiagonal{Float64,Array{Float64,1}} and v Vector{Real} infers as Array{Any,1} #37960
Comments
This is due to julia> Base.promote_op(LinearAlgebra.matprod, Real, Float64)
Any which is the first thing that is executed upon julia> Base.promote_op(*, Real, Float64)
Any
julia> Base.promote_op(*, AbstractFloat, Float64)
Any where |
The reason Julia does this is because although any reasonable subtype of Real should have this property hold, nothing technical stops people from defining unreasonable subtypes. If this method existed, it would have to check The invariant any time someone made a new subtype of Real. |
It's probably not short term. Inference is subject to the halting problem so will never be perfect, and even when it's "just" a question of checking long lists of methods we have to cut it off somewhere or inference time is potentially unbounded. (I could write a script that would generate Candidate solutions are things like #36463, but that's pretty speculative and Jeff points out that it could end up in a bad place. |
First found here - I'm not too familiar with the internals, but it feels like it should be possible to at least infer
Array{Real,1}
.The text was updated successfully, but these errors were encountered: