Skip to content

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
)

@timholy
Copy link
Owner

timholy commented Sep 26, 2024

Thanks very much for the test. Among new features for Revise, this is now top priority. I won't have time for "deep" work on Revise until late October, but if this isn't completed by the end of 2024, please bug me.

Base.Experimental.@MethodTable(method_table)

foo_mt() = 1
Base.Experimental.@overlay method_table foo_mt() = 2
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail if it is Main.method_table since LoweredCodeUtils can't handle the generated expression.

@serenity4
Copy link
Collaborator

Similar tests were part of #904, so I will close this.

@serenity4 serenity4 closed this Jul 26, 2025
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.

3 participants