From d5cde865f24d2c3e7041aee8ea464eb6b6045a2a Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Sun, 25 Sep 2022 15:55:10 +0600 Subject: [PATCH] Don't prompt field names for tuples at the REPL (#46897) --- stdlib/REPL/src/REPLCompletions.jl | 2 +- stdlib/REPL/test/replcompletions.jl | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/stdlib/REPL/src/REPLCompletions.jl b/stdlib/REPL/src/REPLCompletions.jl index 83bc5fa255e9e..579ed230005ee 100644 --- a/stdlib/REPL/src/REPLCompletions.jl +++ b/stdlib/REPL/src/REPLCompletions.jl @@ -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) diff --git a/stdlib/REPL/test/replcompletions.jl b/stdlib/REPL/test/replcompletions.jl index 79821ba8de6e8..721ea06854a80 100644 --- a/stdlib/REPL/test/replcompletions.jl +++ b/stdlib/REPL/test/replcompletions.jl @@ -293,6 +293,12 @@ let @test isempty(c) end +# issue 46800: (3,2). 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")