@@ -883,10 +883,14 @@ end
883
883
@test tree. method == which (StaleA. stale, (String,)) # defined in StaleC
884
884
@test all (be -> Core. MethodInstance (be). def == which (StaleA. stale, (Any,)), tree. backedges)
885
885
if Base. VERSION > v " 1.8.0-DEV.368"
886
- tree = trees[findfirst (tree -> ! isempty (tree. mt_backedges), trees)]
887
- @test only (tree. mt_backedges). first. def == which (StaleA. stale, (Any,))
888
- @test which (only (tree. mt_backedges). first. specTypes) == which (StaleA. stale, (String,))
889
- @test convert (Core. MethodInstance, only (tree. mt_backedges). second). def == which (StaleB. useA, ())
886
+ root = only (filter (tree. backedges) do be
887
+ Core. MethodInstance (be). specTypes. parameters[end ] === String
888
+ end )
889
+ @test convert (Core. MethodInstance, root. children[1 ]). def == which (StaleB. useA, ())
890
+ m2 = which (StaleB. useA2, ())
891
+ if any (item -> isa (item, Core. MethodInstance) && item. def == m2, invalidations) # requires julia#49449
892
+ @test convert (Core. MethodInstance, root. children[1 ]. children[1 ]). def == m2
893
+ end
890
894
tinf = @snoopi_deep begin
891
895
StaleB. useA ()
892
896
StaleC. call_buildstale (" hi" )
@@ -908,10 +912,10 @@ end
908
912
# If we don't discount ones left in an invalidated state,
909
913
# we get mt_backedges with a MethodInstance middle entry too
910
914
strees2 = precompile_blockers (invalidations, tinf; min_world_exclude= 0 )
911
- sig, root, hits = only (only (strees2). mt_backedges )
915
+ root, hits = only (only (strees2). backedges )
912
916
mi_stale = only (filter (mi -> endswith (String (mi. def. file), " StaleA.jl" ), methodinstances (StaleA. stale, (String,))))
913
- @test sig == mi_stale
914
- @test convert (Core . MethodInstance, root) == Core. MethodInstance (only (hits)) == methodinstance (StaleB. useA, ())
917
+ @test Core . MethodInstance (root) == mi_stale
918
+ @test Core. MethodInstance (only (hits)) == methodinstance (StaleB. useA, ())
915
919
# What happens when we can't find it in the tree?
916
920
if any (isequal (" verify_methods" ), invalidations)
917
921
# The 1.9+ format
933
937
# IO
934
938
io = IOBuffer ()
935
939
print (io, trees)
936
- @test occursin (r" stale\( x::String\) (in|@) StaleC.*formerly stale \( x \) (in|@) StaleA " , String (take! (io)))
940
+ @test occursin (r" stale\( x::String\) (in|@) StaleC" , String (take! (io)))
937
941
if ! healed
938
942
print (io, strees)
939
943
str = String (take! (io))
949
953
print (io, only (strees2))
950
954
str = String (take! (io))
951
955
@test occursin (r" inserting stale\( .* (in|@) StaleC.*invalidated:" , str)
952
- @test occursin (" mt_backedges" , str)
956
+ @test ! occursin (" mt_backedges" , str)
953
957
@test occursin (r" blocked.*InferenceTimingNode: .*/.* on StaleB.useA" , str)
954
958
end
955
959
Pkg. activate (cproj)
0 commit comments