Skip to content

Commit c12d8e0

Browse files
timholyaviatesk
andauthored
Fix world age issues in test/toplevel (#671)
--------- Co-authored-by: Shuhei Kadowaki <[email protected]>
1 parent 9f5d98d commit c12d8e0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/optimize.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ function lookup_stmt(stmts::Vector{Any}, @nospecialize arg)
1818
if isa(q, QuoteNode) && isa(q.value, Symbol)
1919
mod = lookup_stmt(stmts, arg.args[2])
2020
if isa(mod, GlobalRef)
21-
mod = getproperty(mod.mod, mod.name)
21+
mod = @invokelatest getglobal(mod.mod, mod.name)
2222
end
23-
isa(mod, Module) && return getproperty(mod, q.value)
23+
isa(mod, Module) && return @invokelatest getglobal(mod, q.value)
2424
end
2525
end
2626
return arg

test/toplevel.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ end
8282
end
8383
@eval using TmpPkg1
8484
# Every package is technically parented in Main but the name may not be visible in Main
85-
@test isdefined(@__MODULE__, :TmpPkg1)
86-
@test !isdefined(@__MODULE__, :TmpPkg2)
85+
@test @eval isdefined(@__MODULE__, :TmpPkg1)
86+
@test @eval !isdefined(@__MODULE__, :TmpPkg2)
8787
collect(ExprSplitter(@__MODULE__, quote
8888
module TmpPkg2
8989
f() = 2
9090
end
9191
end))
92-
@test isdefined(@__MODULE__, :TmpPkg1)
93-
@test !isdefined(@__MODULE__, :TmpPkg2)
92+
@test @eval isdefined(@__MODULE__, :TmpPkg1)
93+
@test @eval !isdefined(@__MODULE__, :TmpPkg2)
9494
end
9595

9696
# Revise issue #718
@@ -119,7 +119,7 @@ module Toplevel end
119119
for (mod, ex) in modexs
120120
frame = Frame(mod, ex)
121121
while true
122-
JuliaInterpreter.through_methoddef_or_done!(frame) === nothing && break
122+
invokelatest(JuliaInterpreter.through_methoddef_or_done!, frame) === nothing && break
123123
end
124124
end
125125

0 commit comments

Comments
 (0)