-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix invalidations in REPL LineEdit.jl from Static.jl #46548
Conversation
stdlib/REPL/src/LineEdit.jl
Outdated
@@ -1560,7 +1560,7 @@ function add_nested_key!(keymap::Dict, key::Union{String, Char}, value; override | |||
if y === nothing | |||
keymap[c] = value | |||
break | |||
elseif !(c in keys(keymap) && isa(keymap[c], Dict)) | |||
elseif !((c in keys(keymap))::Bool && isa(keymap[c], Dict)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not at all familiar with the invalidation business, but judging from the recurrent patterns: the negation acts on the two expressions whose final value is passed to !
, so are you sure you don't need
elseif !((c in keys(keymap))::Bool && isa(keymap[c], Dict)) | |
elseif !((c in keys(keymap) && isa(keymap[c], Dict))::Bool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked with Cthulu and the problem was that c in keys(keymap)
was inferred as Any
.
Looks like there is an opportunity to improve inference here:
If that returned |
* fix invalidations in REPL LineEdit.jl from Static.jl (cherry picked from commit 99d8c7b)
This is based on the following code:
I suggest the labels
latency
andbackport-1.8
.