You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This leads us to believe that q is inferrred to Any and that we have a type instability. However, looking more carefully, we find that q is actually not used in the function body. Instead a new variable, r is introduced which takes the place of q. This one is correctly inferred to be of type Q{Int64}.
Probably related (below, unused y is inferred as Any, on 0.5 inferred as Array{Int64, 1}):
julia>z{T}(x::T, y::Vector{T}) = x
z (generic function with 1 method)
julia>@code_warntypez(3, [1,2])
Variables:#self#::#z
x::Int64
y::Any
Body:beginreturn x::Int64end::Int64
Consider:
Looking at the result we see:
This leads us to believe that
q
is inferrred toAny
and that we have a type instability. However, looking more carefully, we find thatq
is actually not used in the function body. Instead a new variable,r
is introduced which takes the place ofq
. This one is correctly inferred to be of typeQ{Int64}
.On 0.5 the result is instead:
which infers
q
correctly.This probably does not have an impact on performance but makes
@code_warntype
much harder to use since you can't trust your variable names anymore.The text was updated successfully, but these errors were encountered: