From f4e301aa7b421ec63e7bd64ec1e8d8018a2f3ee1 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Fri, 26 Aug 2022 13:10:24 +0200 Subject: [PATCH 1/3] fix invalidations in REPLCompletions from Static.jl --- stdlib/REPL/src/REPLCompletions.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/REPL/src/REPLCompletions.jl b/stdlib/REPL/src/REPLCompletions.jl index 7658a227b51cd..3d0a6b43d406e 100644 --- a/stdlib/REPL/src/REPLCompletions.jl +++ b/stdlib/REPL/src/REPLCompletions.jl @@ -409,9 +409,9 @@ function get_value(sym::Expr, fn) end sym.head !== :. && return (nothing, false) for ex in sym.args - ex, found = get_value(ex, fn) + ex, found::Bool = get_value(ex, fn) !found && return (nothing, false) - fn, found = get_value(ex, fn) + fn, found::Bool = get_value(ex, fn) !found && return (nothing, false) end return (fn, true) From b209400dbfb5b3e2b9543843516ff824dd0d7dd4 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com> Date: Mon, 29 Aug 2022 19:30:21 +0900 Subject: [PATCH 2/3] Apply suggestions from code review --- stdlib/REPL/src/REPLCompletions.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stdlib/REPL/src/REPLCompletions.jl b/stdlib/REPL/src/REPLCompletions.jl index 3d0a6b43d406e..68763ce6aa8e8 100644 --- a/stdlib/REPL/src/REPLCompletions.jl +++ b/stdlib/REPL/src/REPLCompletions.jl @@ -409,9 +409,11 @@ function get_value(sym::Expr, fn) end sym.head !== :. && return (nothing, false) for ex in sym.args - ex, found::Bool = get_value(ex, fn) + exfound = get_value(ex, fn) + ex = exfound[1]; found = exfound[2]::Bool !found && return (nothing, false) - fn, found::Bool = get_value(ex, fn) + exfound = get_value(ex, fn) + ex = exfound[1]; found = exfound[2]::Bool !found && return (nothing, false) end return (fn, true) From 761bdacf84ae39b377472980efc5232c98690c93 Mon Sep 17 00:00:00 2001 From: Hendrik Ranocha Date: Tue, 30 Aug 2022 06:47:43 +0200 Subject: [PATCH 3/3] use suggestion of Tim Holy --- stdlib/REPL/src/REPLCompletions.jl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/stdlib/REPL/src/REPLCompletions.jl b/stdlib/REPL/src/REPLCompletions.jl index 68763ce6aa8e8..83bc5fa255e9e 100644 --- a/stdlib/REPL/src/REPLCompletions.jl +++ b/stdlib/REPL/src/REPLCompletions.jl @@ -409,11 +409,9 @@ function get_value(sym::Expr, fn) end sym.head !== :. && return (nothing, false) for ex in sym.args - exfound = get_value(ex, fn) - ex = exfound[1]; found = exfound[2]::Bool + ex, found = get_value(ex, fn)::Tuple{Any, Bool} !found && return (nothing, false) - exfound = get_value(ex, fn) - ex = exfound[1]; found = exfound[2]::Bool + fn, found = get_value(ex, fn)::Tuple{Any, Bool} !found && return (nothing, false) end return (fn, true)