Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPL completion error #24257

Closed
nalimilan opened this issue Oct 21, 2017 · 5 comments
Closed

REPL completion error #24257

nalimilan opened this issue Oct 21, 2017 · 5 comments
Labels
regression Regression in behavior compared to a previous version REPL Julia's REPL (Read Eval Print Loop)

Comments

@nalimilan
Copy link
Member

If I type Base.Distributed.Cluster.P at the REPL and hit TAB twice, I get this on master but not on 0.6.0:

julia> Base.Distributed.Cluster.PERROR (in the keymap): BoundsError: attempt to access 2-element Array{Any,1} at index [3]
Stacktrace:
 [1] getindex(::Array{Any,1}, ::Int64) at ./array.jl:758
 [2] get_value_getfield(::Expr, ::Module) at ./repl/REPLCompletions.jl:286
 [3] get_value_getfield(::Expr, ::Module) at ./repl/REPLCompletions.jl:284
 [4] try_get_type(::Expr, ::Module) at ./repl/REPLCompletions.jl:328
 [5] try_get_type(::Expr, ::Module) at ./repl/REPLCompletions.jl:340
 [6] get_type(::Expr, ::Module) at ./repl/REPLCompletions.jl:349
 [7] complete_symbol(::String, ::getfield(Base.REPLCompletions, Symbol("##19#23"))) at ./repl/REPLCompletions.jl:62
 [8] completions(::String, ::Int64) at ./repl/REPLCompletions.jl:611
 [9] complete_line(::Base.REPL.REPLCompletionProvider, ::Base.LineEdit.PromptState) at ./repl/REPL.jl:306
 [10] complete_line(::Base.LineEdit.PromptState, ::Int64) at ./repl/LineEdit.jl:238
 [11] complete_line(::Base.LineEdit.MIState) at ./repl/LineEdit.jl:228
 [12] edit_tab(::Base.LineEdit.MIState, ::Bool, ::Bool) at ./repl/LineEdit.jl:1676
 [13] (::getfield(Base.LineEdit, Symbol("##98#141")))(::Base.LineEdit.MIState, ::Base.REPL.LineEditREPL, ::Vararg{Any,N} where N) at ./repl/LineEdit.jl:1709
 [14] (::getfield(Base.LineEdit, Symbol("##19#20")){getfield(Base.LineEdit, Symbol("##98#141")),String})(::Base.LineEdit.MIState, ::Base.REPL.LineEditREPL) at ./repl/LineEdit.jl:1059
 [15] prompt!(::Base.Terminals.TTYTerminal, ::Base.LineEdit.ModalInterface, ::Base.LineEdit.MIState) at ./repl/LineEdit.jl:2061
 [16] run_interface(::Base.Terminals.TTYTerminal, ::Base.LineEdit.ModalInterface) at ./repl/LineEdit.jl:1962
 [17] run_frontend(::Base.REPL.LineEditREPL, ::Base.REPL.REPLBackendRef) at ./repl/REPL.jl:986
 [18] run_repl(::Base.REPL.LineEditREPL, ::getfield(Base, Symbol("##545#546"))) at ./repl/REPL.jl:182
 [19] _start() at ./client.jl:439
@nalimilan nalimilan added regression Regression in behavior compared to a previous version REPL Julia's REPL (Read Eval Print Loop) labels Oct 21, 2017
@dhoegh
Copy link
Contributor

dhoegh commented Oct 23, 2017

Probably caused by #24141.

@nalimilan
Copy link
Member Author

@JeffBezanson ^

@nalimilan
Copy link
Member Author

This still happens on current master (with a single Tab press).

@vtjnash
Copy link
Member

vtjnash commented Feb 16, 2019

Line 355 (from f8196cc!) assumes that it's only legal to call the getfield function on values gotten from other calls to getfield (without error checking):

    352 # Return the value of a getfield call expression
    353 function get_value_getfield(ex::Expr, fn)
    354     # Example :((top(getfield))(Base, :max))
    355     val, found = get_value_getfield(ex.args[2], fn) #Look up Base in Main and returns the module
    356     found || return (nothing, false)
    357     return get_value_getfield(ex.args[3], val) #Look up max in Base and returns the function if found.
    358 end
    359 get_value_getfield(sym, fn) = get_value(sym, fn)

@musm
Copy link
Contributor

musm commented Aug 7, 2020

fixed? I dont' see this anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Regression in behavior compared to a previous version REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

No branches or pull requests

4 participants