Skip to content

Commit 788b4ea

Browse files
committed
Use MethodInfoKey instead of relying on implicit conversions
1 parent 1949618 commit 788b4ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/runtests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using CodeTracking
44
using Test, InteractiveUtils, REPL, LinearAlgebra, SparseArrays
55
# Note: ColorTypes needs to be installed, but note the intentional absence of `using ColorTypes`
66

7-
using CodeTracking: line_is_decl
7+
using CodeTracking: line_is_decl, MethodInfoKey
88

99
if !isempty(ARGS) && "revise" ARGS
1010
# For running tests with and without Revise
@@ -101,7 +101,7 @@ isdefined(Main, :Revise) ? Main.Revise.includet("script.jl") : include("script.j
101101

102102
# Test a method marked as missing
103103
m = @which sum(1:5)
104-
CodeTracking.invoked_setindex!(CodeTracking.method_info, missing, nothing => m.sig)
104+
CodeTracking.method_info[MethodInfoKey(nothing, m.sig)] = missing
105105
@test whereis(m) == (CodeTracking.maybe_fix_path(String(m.file)), m.line)
106106
@test definition(m) === nothing
107107

@@ -466,7 +466,7 @@ if isdefined(Base, :Experimental) && isdefined(Base.Experimental, :(var"@MethodT
466466
method = Core.eval(mod, ex)
467467
lnn = LineNumberNode(Int(method.line), method.file)
468468
@test CodeTracking.definition(Expr, method) === nothing
469-
CodeTracking.invoked_setindex!(CodeTracking.method_info, [(lnn, ex)], method.external_mt => method.sig)
469+
CodeTracking.method_info[MethodInfoKey(method)] = [(lnn, ex)]
470470
@test CodeTracking.definition(Expr, method) == ex
471471
end
472472

0 commit comments

Comments
 (0)