Skip to content

Commit

Permalink
fixes #20
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeInnes committed Mar 4, 2018
1 parent bd4748f commit 80b5d84
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/interpret.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function _step_expr(frame, pc)
if node.head == :(=)
lhs = node.args[1]
if isexpr(node.args[2], :new)
new_expr = Expr(:new, map(x->lookup_var_if_var(frame, x), node.args[2].args)...)
new_expr = Expr(:new, map(x->QuoteNode(lookup_var_if_var(frame, x)), node.args[2].args)...)
rhs = eval(frame.meth.module, new_expr)
else
rhs = (isexpr(node.args[2], :call) || isexpr(node.args[2], :foreigncall)) ? evaluate_call(frame, node.args[2]) :
Expand Down
7 changes: 7 additions & 0 deletions test/interpret.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,11 @@ end

@assert step_through(enter_call_expr(:($(foo_sym)()))) == Symbol

# Make sure evalling "new" works with symbols

function new_sym()
a = :a
() -> a
end

step_through(enter_call_expr(:($new_sym())))
2 changes: 1 addition & 1 deletion test/stepping.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,4 @@ try
execute_command(state, state.stack[1], Val{:n}(), "n")
catch e
@assert isa(e, ErrorException)
end
end

0 comments on commit 80b5d84

Please sign in to comment.