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
Start by defining a function for which it is impossible to generate exact information:
julia>functiong()
g(i,2)
end# methods for generic function gg() at none:2
julia>g(::Any,::Int) =2# methods for generic function gg() at none:2g(::Any,::Int64) at none:1
Looking at the finfer result, we see julia has assumed too much, even though it will call jl_apply_generic and does not know the run-time return type:
julia>finfer(g,())
:($(Expr(:lambda, {}, {{},{},{}}, quote# none, line 2:returng(i,2)::Int64end)))
And in fact, we can break it quite easily:
julia> g(::Int,::Int) = 3.0
# methods for generic function g
g() at none:2
g(::Int64,::Int64) at none:1
g(::Any,::Int64) at none:1
julia> finfer(g,())
:($(Expr(:lambda, {}, {{},{},{}}, quote # none, line 2:
return g(i,2)::Int64
end)))
julia> i=1
1
julia> g()
4613937818241073152
julia> reinterpret(Float64, ans)
3.0
The text was updated successfully, but these errors were encountered:
Start by defining a function for which it is impossible to generate exact information:
Looking at the finfer result, we see julia has assumed too much, even though it will call jl_apply_generic and does not know the run-time return type:
And in fact, we can break it quite easily:
The text was updated successfully, but these errors were encountered: