Skip to content

Commit f977b9f

Browse files
committed
Fix ~50 invalidations stemming from modules_to_be_loaded
ChainRulesCore defines `==(a, b::AbstractThunk)` and its converse, and these end up invaliding parts of the REPL (including `eval_user_input`) via inference failures in `modules_to_be_loaded`.
1 parent 2ebbb2b commit f977b9f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

stdlib/REPL/src/REPL.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,17 @@ function check_for_missing_packages_and_run_hooks(ast)
177177
end
178178
end
179179

180-
function modules_to_be_loaded(ast, mods = Symbol[])
180+
function modules_to_be_loaded(ast::Expr, mods = Symbol[])
181181
if ast.head in [:using, :import]
182182
for arg in ast.args
183-
if first(arg.args) isa Symbol # i.e. `Foo`
184-
if first(arg.args) != :. # don't include local imports
185-
push!(mods, first(arg.args))
183+
arg = arg::Expr
184+
arg1 = first(arg.args)
185+
if arg1 isa Symbol # i.e. `Foo`
186+
if arg1 != :. # don't include local imports
187+
push!(mods, arg1)
186188
end
187189
else # i.e. `Foo: bar`
188-
push!(mods, first(first(arg.args).args))
190+
push!(mods, first((arg1::Expr).args))
189191
end
190192
end
191193
end

0 commit comments

Comments
 (0)