diff --git a/stdlib/REPL/src/REPLCompletions.jl b/stdlib/REPL/src/REPLCompletions.jl index 77d5d87e41b8c..6845f1bc284fd 100644 --- a/stdlib/REPL/src/REPLCompletions.jl +++ b/stdlib/REPL/src/REPLCompletions.jl @@ -144,7 +144,7 @@ function complete_symbol(sym::String, ffunc, context_module::Module=Main) if isa(b, Module) mod = b lookup_module = true - elseif Base.isstructtype(typeof(b)) + else lookup_module = false t = typeof(b) end diff --git a/stdlib/REPL/test/replcompletions.jl b/stdlib/REPL/test/replcompletions.jl index 14f6de445c083..671afd6c30073 100644 --- a/stdlib/REPL/test/replcompletions.jl +++ b/stdlib/REPL/test/replcompletions.jl @@ -32,6 +32,10 @@ let ex = quote :() end + primitive type NonStruct 8 end + Base.propertynames(::NonStruct) = (:a, :b, :c) + x = reinterpret(NonStruct, 0x00) + # Support non-Dict AbstractDicts, #19441 mutable struct CustomDict{K, V} <: AbstractDict{K, V} mydict::Dict{K, V} @@ -1145,6 +1149,11 @@ let s = "test_dict[\"ab" @test c == Any["\"abc\"", "\"abcd\""] end +let s = "CompletionFoo.x." + c, r = test_complete(s) + @test "a" in c +end + # https://github.com/JuliaLang/julia/issues/27184 let (test_complete("@noexist."); @test true)