Skip to content

Commit de63569

Browse files
committed
Fix MethodInstance multiplicity
Formerly this seemed to return a single MethodInstance, but now it returns two. The change is may be from improvements to MethodAnalysis, likely timholy/MethodAnalysis.jl#27. The new behavior is certainly the correct one (there are two distinct methods, so there had better be two MethodInstances with that signature---even though one will never get another CodeInstance).
1 parent 232f2f7 commit de63569

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/snoopi_deep.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,8 @@ end
889889
# we get mt_backedges with a MethodInstance middle entry too
890890
strees2 = precompile_blockers(invalidations, tinf; min_world_exclude=0)
891891
sig, root, hits = only(only(strees2).mt_backedges)
892-
@test sig == methodinstance(StaleA.stale, (String,))
892+
mi_stale = only(filter(mi -> endswith(String(mi.def.file), "StaleA.jl"), methodinstances(StaleA.stale, (String,))))
893+
@test sig == mi_stale
893894
@test root == Core.MethodInstance(only(hits)) == methodinstance(StaleB.useA, ())
894895
# What happens when we can't find it in the tree?
895896
idx = findfirst(isequal("jl_method_table_insert"), invalidations)

0 commit comments

Comments
 (0)