Skip to content
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

Add test for Overlay Method Tables #815

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vchuravy
Copy link

Adds the test for #646 (still broken).

Of note is that in the REPL this works fine:

julia> Base.Experimental.@MethodTable(method_table)
# 0 methods for callable object

julia> foo() = 1
foo (generic function with 1 method)

julia> Base.Experimental.@overlay Main.method_table foo() = 2

julia> methods = Base._methods_by_ftype(Tuple{typeof(foo)}, method_table, 1, Base.get_world_counter())
1-element Vector{Any}:
 Core.MethodMatch(Tuple{typeof(foo)}, svec(), foo() @ Main REPL[3]:1, true)

julia> display(Base.uncompressed_ir(methods[1].method))
CodeInfo(
1 ─     return 2
)

julia> Base.Experimental.@overlay Main.method_table foo() = 3

julia> methods = Base._methods_by_ftype(Tuple{typeof(foo)}, method_table, 1, Base.get_world_counter())
1-element Vector{Any}:
 Core.MethodMatch(Tuple{typeof(foo)}, svec(), foo() @ Main REPL[6]:1, true)

julia> display(Base.uncompressed_ir(methods[1].method))
CodeInfo(
1 ─     return 3
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant