Skip to content

Commit

Permalink
Don't prompt field names for tuples at the REPL (#46897)
Browse files Browse the repository at this point in the history
(cherry picked from commit d5cde86)
  • Loading branch information
LilithHafner authored and KristofferC committed Oct 28, 2022
1 parent 85155e1 commit 1b70b0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/REPL/src/REPLCompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function complete_symbol(sym::String, @nospecialize(ffunc), context_module::Modu
t = typeof(t.parameters[1])
end
# Only look for fields if this is a concrete type
if isconcretetype(t)
if isconcretetype(t) && !(t <: Tuple)
fields = fieldnames(t)
for field in fields
s = string(field)
Expand Down
6 changes: 6 additions & 0 deletions stdlib/REPL/test/replcompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@ let
@test isempty(c)
end

# issue 46800: (3,2).<TAB> errors in the REPL
let
c, r = test_complete("(3,2).")
@test isempty(c)
end

# inexistent completion inside a string
let s = "Base.print(\"lol"
c, r, res = test_complete(s)
Expand Down

0 comments on commit 1b70b0f

Please sign in to comment.