-
-
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
stagedfunction fails to update cache #10178
Comments
Sorry, this could have been more succinct: stagedfunction f{X}(x::X)
:(x)
end
g(x) = f(x)
@assert g(5)==5
stagedfunction f{X}(x::X)
:(2x)
end
g(x) = f(x)
@assert g(5)==10 Throws in current 0.4 but worked in bcd0e5e. Bonus trick, works in both versions if wrapped in a let-block. |
And last bit of noise: @Jutho |
Well, this is clearly caused by the function Base.func_for_method(m::Method, tt, env)
if !m.isstaged
return m.func.code
else
f=ccall(:jl_instantiate_staged,Any,(Any,Any,Any),m,tt,env)
return f.code
end
end fixes your problem. But then again, we knew this could happen if PR #9921 got merged without anybody looking at it who actually understands what's going on in |
Thanks for work-around. And a stagedfuntions label would probably be good. |
This was resolved in julia-0.5. Is the test as in #10178 (comment) desired? |
In some corner cases it seems that the stagedfunction cache is not updated. Consider:
With version bcd0e5e of julia-0.4 (mid-January) I get output:
with a current build 1a9e1b1 I get this:
I suspect the culprit is PR #9921
The text was updated successfully, but these errors were encountered: