Skip to content

Commit

Permalink
Fix/disable tests on 1.9 (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy authored Mar 23, 2023
1 parent cac9444 commit 37492ce
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/findcallers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ function findcallers(f, argmatch::Union{Function,Nothing}, mis::AbstractVector{C
callee = nothing
if stmt.head === callhead
callee = stmt.args[1]
if isglobalref(callee, Core, :kwcall) && length(stmt.args) >= 3
callee = stmt.args[3]
end
elseif callhead === :iterate && stmt.head === :call && isglobalref(stmt.args[1], Core, :_apply_iterate)
callee = stmt.args[3]
end
Expand Down
20 changes: 12 additions & 8 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,20 @@ end

@testset "visit" begin
# Do we pick up kwfuncs?
meths = Set{Method}()
visit(Outer) do item
if item isa Method
push!(meths, item)
return false
# This is skipped on Julia versions that use `Core.kwcall`, as the methods are found by traversing Core.
# See issue #36
if !isdefined(Core, :kwcall)
meths = Set{Method}()
visit(Outer) do item
if item isa Method
push!(meths, item)
return false
end
return true
end
return true
mkw = only(methods(Core.kwfunc(Outer.fkw), (Any, typeof(Outer.fkw), Vararg{Any})))
@test mkw in meths
end
mkw = only(methods(Core.kwfunc(Outer.fkw), (Any, typeof(Outer.fkw), Vararg{Any})))
@test mkw in meths

@test Outer.Inner.g("hi") == 0
@test Outer.f(nothing) == 1
Expand Down

0 comments on commit 37492ce

Please sign in to comment.