Skip to content

Commit b4a3215

Browse files
LilithHafnerKristofferC
authored andcommitted
Don't prompt field names for tuples at the REPL (#46897)
(cherry picked from commit d5cde86)
1 parent df4c852 commit b4a3215

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

stdlib/REPL/src/REPLCompletions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function complete_symbol(sym::String, @nospecialize(ffunc), context_module::Modu
195195
t = typeof(t.parameters[1])
196196
end
197197
# Only look for fields if this is a concrete type
198-
if isconcretetype(t)
198+
if isconcretetype(t) && !(t <: Tuple)
199199
fields = fieldnames(t)
200200
for field in fields
201201
s = string(field)

stdlib/REPL/test/replcompletions.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,12 @@ let
270270
@test isempty(c)
271271
end
272272

273+
# issue 46800: (3,2).<TAB> errors in the REPL
274+
let
275+
c, r = test_complete("(3,2).")
276+
@test isempty(c)
277+
end
278+
273279
# inexistent completion inside a string
274280
let s = "Base.print(\"lol"
275281
c, r, res = test_complete(s)

0 commit comments

Comments
 (0)