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

BoundsError: attempt to access 2-element Array #216

Closed
Roger-luo opened this issue Jan 3, 2019 · 4 comments · Fixed by JuliaLang/julia#30569
Closed

BoundsError: attempt to access 2-element Array #216

Roger-luo opened this issue Jan 3, 2019 · 4 comments · Fixed by JuliaLang/julia#30569

Comments

@Roger-luo
Copy link

Details

  • Atom version: 1.33.1
  • Julia version: 1.0.1
  • OS: Mac OS
  • Package versions:
    • Atom.jl: v0.7.11
    • julia-client: 0.7.11
    • ink: 0.9.13

Steps to reproduce

  1. run the following
ex = :(function foo(::Int) end)
  1. type the following
ex.args[1].args[2].
@pfitzseb
Copy link
Member

pfitzseb commented Jan 3, 2019

Seems like a bug in Base:

julia> ex = :(function foo(::Int) end)
:(function foo(::Int)
      #= REPL[6]:1 =#
  end)

julia> ex.args[1].args[2].┌ Error: Error in the keymap
│   exception =
│    BoundsError: attempt to access 2-element Array{Any,1} at index [3]
│    Stacktrace:
│     [1] getindex at ./array.jl:731 [inlined]
...

@yha
Copy link
Contributor

yha commented Jan 6, 2019

A similar error, thrown from the same function in REPLCompletions.jl, two lines earlier:
After using Plots, typing

plot(log.(x),

produces

BoundsError: attempt to access 1-element Array{Any,1} at index [2]
getindex at array.jl:731 [inlined]
get_value_getfield(::Expr, ::Function) at REPLCompletions.jl:355
get_value_getfield(::Expr, ::Module) at REPLCompletions.jl:357
[...]

Edit: seems this was reported in #209 without reproducing code.
Edit 2:
can be reproduced without Plots, with

log(log.(x),

or any other currently defined variable in place of log (x doesn't have to be defined to trigger the error).

@pfitzseb
Copy link
Member

pfitzseb commented Jan 7, 2019

Fixed with JunoLab/Atom.jl@4af4d3e on our end.

@pfitzseb pfitzseb closed this as completed Jan 7, 2019
@pfitzseb
Copy link
Member

pfitzseb commented Jan 7, 2019

Upstream fix is included in JuliaLang/julia#30569.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants