diff --git a/Project.toml b/Project.toml index 96d1858..5b1b1b3 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Tricks" uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775" authors = ["Frames White"] -version = "0.1.9" +version = "0.1.10" [compat] julia = "1.0" diff --git a/src/Tricks.jl b/src/Tricks.jl index 0cd8749..c8c8de3 100644 --- a/src/Tricks.jl +++ b/src/Tricks.jl @@ -100,7 +100,11 @@ function _method_table_all_edges_all_methods(f, T, world = Base.get_world_counte # We add an edge to the MethodTable itself so that when any new methods # are defined, it recompiles the function. - mt_edges = Core.Compiler.vect(mt, Tuple{f,Vararg{Any}}) + @static if VERSION < v"1.12.0-DEV.1531" + mt_edges = Core.Compiler.vect(mt, Tuple{f,Vararg{Any}}) + else + mt_edges = Core.Compiler.vect(Tuple{f, Vararg{Any}}, mt) + end # We want to add an edge to _every existing method instance_, so that # the deletion of any one of them will trigger recompilation of the function. diff --git a/test/runtests.jl b/test/runtests.jl index 3b1e384..f9e2d27 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -125,7 +125,7 @@ end @test static_method_count(j) == 2 @test (length ∘ collect ∘ static_methods)(j, Tuple{Int}) == 1 - @test static_method_count(j, Tuple{Int,Int}) == 1 + @test static_method_count(j, Tuple{Int}) == 1 @test (length ∘ collect ∘ static_methods)(j, Tuple{Int,Int}) == 1 @test static_method_count(j, Tuple{Int,Int}) == 1 @test (length ∘ collect ∘ static_methods)(j, Tuple{Int,Int,Int}) == 1 @@ -158,7 +158,7 @@ end while length(collect(methods(j))) > 0 Base.delete_method((first ∘ methods)(j)) - + @static isdefined(Core, Symbol("@latestworld")) && Core.@latestworld T = Tuple{Any, Vararg{Any}} @test (length ∘ collect ∘ static_methods)(j, T) == length(collect(methods(j))) @test static_method_count(j, T) == length(collect(methods(j)))