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
  • Loading branch information
LilithHafner authored Sep 25, 2022
1 parent e6d9979 commit d5cde86
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 @@ -202,7 +202,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 @@ -293,6 +293,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
@test_nocompletion("Base.print(\"lol")

Expand Down

1 comment on commit d5cde86

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

Please sign in to comment.