Skip to content

Commit 33f92d6

Browse files
authored
minor refactor for Base._which (JuliaLang#40617)
Two minor changes: 1. look up matching methods in a passed world 2. pass the current world by default xref: JuliaDebug/JuliaInterpreter.jl#478
1 parent 4b7670d commit 33f92d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/reflection.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,12 +1292,12 @@ end
12921292

12931293
print_statement_costs(args...; kwargs...) = print_statement_costs(stdout, args...; kwargs...)
12941294

1295-
function _which(@nospecialize(tt::Type), world=typemax(UInt))
1295+
function _which(@nospecialize(tt::Type), world=get_world_counter())
12961296
min_valid = RefValue{UInt}(typemin(UInt))
12971297
max_valid = RefValue{UInt}(typemax(UInt))
12981298
match = ccall(:jl_gf_invoke_lookup_worlds, Any,
12991299
(Any, UInt, Ptr{Csize_t}, Ptr{Csize_t}),
1300-
tt, typemax(UInt), min_valid, max_valid)
1300+
tt, world, min_valid, max_valid)
13011301
if match === nothing
13021302
error("no unique matching method found for the specified argument types")
13031303
end

0 commit comments

Comments
 (0)