Skip to content

Commit 6105500

Browse files
committed
typeinfer: Work around inference bug
See #58143 for details.
1 parent 0e29daa commit 6105500

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Compiler/src/typeinfer.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,14 +1600,12 @@ function typeinf_ext_toplevel(methods::Vector{Any}, worlds::Vector{UInt}, trim_m
16001600
codeinfos = []
16011601
is_latest_world = true # whether this_world == world_counter()
16021602
workqueue = CompilationQueue(; interp = nothing)
1603-
for (i, this_world) in enumerate(sort!(worlds))
1603+
for this_world in reverse!(sort!(worlds))
16041604
workqueue = CompilationQueue(workqueue;
16051605
interp = NativeInterpreter(this_world; inf_params)
16061606
)
16071607

16081608
append!(workqueue, methods)
1609-
1610-
is_latest_world = (i == length(worlds))
16111609
if is_latest_world
16121610
# Provide the `invokelatest` queue so that we trigger "best-effort" code generation
16131611
# for, e.g., finalizers and cfunction.
@@ -1618,6 +1616,7 @@ function typeinf_ext_toplevel(methods::Vector{Any}, worlds::Vector{UInt}, trim_m
16181616
else
16191617
compile!(codeinfos, workqueue)
16201618
end
1619+
is_latest_world = false
16211620
end
16221621

16231622
if trim_mode != TRIM_NO && trim_mode != TRIM_UNSAFE

0 commit comments

Comments
 (0)