Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

@enter fails for simple kwarg function #34

Closed
staticfloat opened this issue Jan 18, 2019 · 2 comments
Closed

@enter fails for simple kwarg function #34

staticfloat opened this issue Jan 18, 2019 · 2 comments
Assignees
Labels

Comments

@staticfloat
Copy link

julia> function foo(a, b; c="foo", d="bar")
       return sum(a .+ b), c * d
       end
foo (generic function with 1 method)

julia> a = randn(10); b = a; @enter foo(a, b; c="haha")
ERROR: MethodError: no method matching haskey(::Array{Any,1}, ::Symbol)
Closest candidates are:
  haskey(::Base.TTY, ::Symbol) at stream.jl:480
  haskey(::Base.Iterators.Pairs, ::Any) at iterators.jl:247
  haskey(::Dict, ::Any) at dict.jl:546
  ...
Stacktrace:
 [1] evaluate_call(::ASTInterpreter2.JuliaStackFrame, ::Expr) at /home/staticfloat/.julia/dev/ASTInterpreter2/src/interpret.jl:66
 [2] eval_rhs(::ASTInterpreter2.JuliaStackFrame, ::Expr) at /home/staticfloat/.julia/dev/ASTInterpreter2/src/interpret.jl:93
 [3] _step_expr(::ASTInterpreter2.JuliaStackFrame, ::ASTInterpreter2.JuliaProgramCounter) at /home/staticfloat/.julia/dev/ASTInterpreter2/src/interpret.jl:115
 [4] next_until!(::getfield(ASTInterpreter2, Symbol("##7#8")), ::ASTInterpreter2.JuliaStackFrame, ::ASTInterpreter2.JuliaProgramCounter) at /home/staticfloat/.julia/dev/ASTInterpreter2/src/interpret.jl:172
 [5] next_call!(::ASTInterpreter2.JuliaStackFrame, ::ASTInterpreter2.JuliaProgramCounter) at /home/staticfloat/.julia/dev/ASTInterpreter2/src/interpret.jl:177
 [6] maybe_step_through_wrapper!(::Array{ASTInterpreter2.JuliaStackFrame,1}) at /home/staticfloat/.julia/dev/ASTInterpreter2/src/ASTInterpreter2.jl:399
 [7] top-level scope at /home/staticfloat/.julia/dev/ASTInterpreter2/src/ASTInterpreter2.jl:465
@KristofferC
Copy link
Member

Still fails with #37

julia>  ASTInterpreter2.@enter foo(a, b; c="haha")
ERROR: MethodError: no method matching haskey(::Array{Any,1}, ::Symbol)
Closest candidates are:
  haskey(::Base.TTY, ::Symbol) at stream.jl:480
  haskey(::Base.Iterators.Pairs, ::Any) at iterators.jl:247
  haskey(::Dict, ::Any) at dict.jl:546
  ...
Stacktrace:
 [1] evaluate_call! at C:\Users\Kristoffer\ASTInterpreter2.jl\src\interpret.jl:112 [inlined]
 [2] _step_expr!(::Compiled, ::JuliaStackFrame, ::ASTInterpreter2.JuliaProgramCounter) at C:\Users\Kristoffer\ASTInterpreter2.jl\src\interpret.jl:205
 [3] next_until!(::getfield(ASTInterpreter2, Symbol("##7#8")), ::Compiled, ::JuliaStackFrame, ::ASTInterpreter2.JuliaProgramCounter) at C:\Users\Kristoffer\ASTInterpreter2.jl\src\interpret.jl:311
 [4] next_call!(::Compiled, ::JuliaStackFrame, ::ASTInterpreter2.JuliaProgramCounter) at C:\Users\Kristoffer\ASTInterpreter2.jl\src\interpret.jl:316
 [5] maybe_step_through_wrapper!(::Array{JuliaStackFrame,1}) at C:\Users\Kristoffer\ASTInterpreter2.jl\src\ASTInterpreter2.jl:837
 [6] top-level scope at C:\Users\Kristoffer\ASTInterpreter2.jl\src\ASTInterpreter2.jl:904

@timholy
Copy link
Member

timholy commented Jan 28, 2019

Fixed by #40

@timholy timholy closed this as completed Jan 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants