macro add(num)
addnum = parse("add"*string(num))
return esc(quote
$num(x...) = $addnum(x...)
end)
end
@add(one)
@add(two)
function addone(k::Integer)
k = k + 1
return k
end
function addtwo(k::Integer)
k = k + 2
return k
end
I expected to be able to step into function addone. But, it was totally skipped.
julia> @enter one(2)
In one(x) at /home/chobbes/code/test_macro.jl:4
4 $num(x...) = $addnum(x...)
5 end)
6 end
About to run: (Core._apply)(addone, (2,))
1|debug > s
In one(x) at /home/chobbes/code/test_macro.jl:4
4 $num(x...) = $addnum(x...)
5 end)
6 end
About to run: return 3
1|debug >
julia>
If the splatting ... is removed in the above code, the ASTInterpreter then would step in the function.
Today I found even more cases where ASTInterpreter2 fails to step in a function. I wish I could have time to work out a MWE for each case. Any fix (or botch) is much appreciated!
Thanks a lot, @Keno. I wasn’t 100% sure if it is a bug. An issue can’t be deleted on Github. Don’t want to contaminate the repo by a false issue in case I misjudge.
After checking out the commits pushed to ASTInterpret2 and DebuggerFramework in the last few days, debugger ceased to work. Macro @enter throws an error message: