Skip to content

Commit 6cbf20a

Browse files
authored
Merge pull request #45 from chengchingwen/fix1.12
fix for julia v1.12 edge format changes
2 parents ac53de4 + a513a2e commit 6cbf20a

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Tricks"
22
uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775"
33
authors = ["Frames White"]
4-
version = "0.1.9"
4+
version = "0.1.10"
55

66
[compat]
77
julia = "1.0"

src/Tricks.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ function _method_table_all_edges_all_methods(f, T, world = Base.get_world_counte
100100

101101
# We add an edge to the MethodTable itself so that when any new methods
102102
# are defined, it recompiles the function.
103-
mt_edges = Core.Compiler.vect(mt, Tuple{f,Vararg{Any}})
103+
@static if VERSION < v"1.12.0-DEV.1531"
104+
mt_edges = Core.Compiler.vect(mt, Tuple{f,Vararg{Any}})
105+
else
106+
mt_edges = Core.Compiler.vect(Tuple{f, Vararg{Any}}, mt)
107+
end
104108

105109
# We want to add an edge to _every existing method instance_, so that
106110
# the deletion of any one of them will trigger recompilation of the function.

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ end
125125
@test static_method_count(j) == 2
126126

127127
@test (length collect static_methods)(j, Tuple{Int}) == 1
128-
@test static_method_count(j, Tuple{Int,Int}) == 1
128+
@test static_method_count(j, Tuple{Int}) == 1
129129
@test (length collect static_methods)(j, Tuple{Int,Int}) == 1
130130
@test static_method_count(j, Tuple{Int,Int}) == 1
131131
@test (length collect static_methods)(j, Tuple{Int,Int,Int}) == 1
@@ -158,7 +158,7 @@ end
158158

159159
while length(collect(methods(j))) > 0
160160
Base.delete_method((first methods)(j))
161-
161+
@static isdefined(Core, Symbol("@latestworld")) && Core.@latestworld
162162
T = Tuple{Any, Vararg{Any}}
163163
@test (length collect static_methods)(j, T) == length(collect(methods(j)))
164164
@test static_method_count(j, T) == length(collect(methods(j)))

0 commit comments

Comments
 (0)