Skip to content

Commit 4ab5293

Browse files
authored
Add a couple more REPL signature types (#37584)
These prevent some invalidations from poor inference on `keys`.
1 parent 0c45e83 commit 4ab5293

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

stdlib/REPL/src/LineEdit.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,9 +1512,10 @@ function fixup_keymaps!(dict::Dict{Char,Any}, level, s, subkeymap)
15121512
nothing
15131513
end
15141514

1515-
function add_specialisations(dict::Dict{Char,Any}, subdict, level)
1515+
function add_specialisations(dict::Dict{Char,Any}, subdict::Dict{Char,Any}, level::Int)
15161516
default_branch = subdict[wildcard]
15171517
if isa(default_branch, Dict)
1518+
default_branch = default_branch::Dict{Char,Any}
15181519
# Go through all the keymaps in the default branch
15191520
# and copy them over to dict
15201521
for s in keys(default_branch)
@@ -1549,7 +1550,7 @@ end
15491550

15501551
# `target` is the total keymap being built up, already being a nested tree of Dicts.
15511552
# source is the keymap specified by the user (with normalized keys)
1552-
function keymap_merge(target::Dict{Char,Any}, source::Dict)
1553+
function keymap_merge(target::Dict{Char,Any}, source::Union{Dict{Char,Any},AnyDict})
15531554
ret = copy(target)
15541555
direct_keys = filter(p -> isa(p.second, Union{Function, KeyAlias, Nothing}), source)
15551556
# first direct entries

0 commit comments

Comments
 (0)