-
Notifications
You must be signed in to change notification settings - Fork 111
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
Restart reason: Change in binding resolution #239
Labels
julialimit
Feature requires changes to julia
Comments
Interesting. The rewrite I'm getting started on now, based on lowered code (JuliaDebug/ASTInterpreter2.jl#32), offers an opportunity to fix this via backedges. Your timing was fortuitous. |
I have a "fix" for this in the branch julia> first = 0
0
julia> first = Base.first
first (generic function with 24 methods) but when you try this with functions: julia> struct Iter end
julia> iterate(i::Iter) = i, nothing
iterate (generic function with 1 method)
julia> iterate(i::Iter, ::Any) = nothing
iterate (generic function with 2 methods)
julia> mths = methods(iterate)
# 2 methods for generic function "iterate":
[1] iterate(i::Iter) in Main at REPL[2]:1
[2] iterate(i::Iter, ::Any) in Main at REPL[3]:1
julia> Base.delete_method(mths.ms[1])
julia> Base.delete_method(mths.ms[2])
julia> iterate = Base.iterate
ERROR: invalid redefinition of constant iterate
Stacktrace:
[1] top-level scope at none:0 Know of any workaround? |
Merged
timholy
added a commit
that referenced
this issue
Nov 22, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Say you accidentally write something like this in a package:
The second definition is wrong. What was intended was to extend
Base.iterate
. Now, if I add the missingBase.
, revise will delete the method, but the binding infoo
will still resolve to the (now methodless) iterate function in my module. Not sure this can be addressed in the near term, but wanted to document it as a reason I had to restart my session.The text was updated successfully, but these errors were encountered: