Skip to content

Commit aad26e5

Browse files
authored
restore method count after redefinition to hide old definition (JuliaLang#57837)
Purely on the external show, since the method does still exist for internals purposes (e.g. method deletion) and is already filtered for inference users (with lim > 0). Close JuliaLang#53814
1 parent 2794485 commit aad26e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/invalidation.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ begin
142142
# this redefinition below should invalidate the cache of `pr48932_callee` but not that of `pr48932_caller`
143143
pr48932_callee(x) = (print(GLOBAL_BUFFER, x); nothing)
144144

145-
@test length(Base.methods(pr48932_callee)) == 2
146-
@test Base.only(Base.methods(pr48932_callee, Tuple{Any})) === first(Base.methods(pr48932_callee))
145+
@test length(Base.methods(pr48932_callee)) == 1
146+
@test Base.only(Base.methods(pr48932_callee, Tuple{Any})) === only(Base.methods(pr48932_callee))
147147
@test isempty(Base.specializations(Base.only(Base.methods(pr48932_callee, Tuple{Any}))))
148148
let mi = only(Base.specializations(Base.only(Base.methods(pr48932_caller))))
149149
# Base.method_instance(pr48932_callee, (Any,))

0 commit comments

Comments
 (0)