You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I execute this, for example (Jupyter Notebook):
@bouncefunctionpair(n)
return n >1?pair(n -2) :1- n
end
I get the following error:
LoadError: MethodError: Cannot `convert` an object of type Expr to an object of type Symbol
Closest candidates are:
convert(::Type{T}, !Matched::T) where T at essentials.jl:171
Symbol(::Any...) at strings/basic.jl:227
in expression starting at In[136]:1
Stacktrace:
[1] push!(::Array{Symbol,1}, ::Expr) at .\array.jl:934
[2] (::Lazy.var"#17#18"{Array{Symbol,1}})(::Expr) at C:\Users\username\.julia\packages\Lazy\9Xnd3\src\tail.jl:128
[3] macro expansion at C:\Users\username\.julia\packages\Lazy\9Xnd3\src\tail.jl:44 [inlined]
[4] macro expansion at C:\Users\username\.julia\packages\MacroTools\X77lQ\src\match\macro.jl:18 [inlined]
[5] lastcalls(::Lazy.var"#17#18"{Array{Symbol,1}}, ::Expr) at C:\Users\username\.julia\packages\Lazy\9Xnd3\src\tail.jl:7
[6] macro expansion at C:\Users\username\.julia\packages\Lazy\9Xnd3\src\tail.jl:44 [inlined]
[7] macro expansion at C:\Users\username\.julia\packages\MacroTools\X77lQ\src\match\macro.jl:18 [inlined]
[8] lastcalls(::Lazy.var"#17#18"{Array{Symbol,1}}, ::Expr) at C:\Users\username\.julia\packages\Lazy\9Xnd3\src\tail.jl:7
[9] (::Lazy.var"#13#14"{Lazy.var"#17#18"{Array{Symbol,1}}})(::Expr) at C:\Users\username\.julia\packages\Lazy\9Xnd3\src\tail.jl:22
[10] walk(::Expr, ::Function, ::Lazy.var"#13#14"{Lazy.var"#17#18"{Array{Symbol,1}}}) at C:\Users\username\.julia\packages\MacroTools\X77lQ\src\utils.jl:105
[11] postwalk(::Function, ::Expr) at C:\Users\username\.julia\packages\MacroTools\X77lQ\src\utils.jl:114
[12] retcalls(::Function, ::Expr) at C:\Users\username\.julia\packages\Lazy\9Xnd3\src\tail.jl:21
[13] tailcalls(::Function, ::Expr) at C:\Users\username\.julia\packages\Lazy\9Xnd3\src\tail.jl:26
[14] @bounce(::LineNumberNode, ::Module, ::Any) at C:\Users\username\.julia\packages\Lazy\9Xnd3\src\tail.jl:128
[15] include_string(::Function, ::Module, ::String, ::String) at .\loading.jl:1091
I suspected that it had something to do with LineNumberNode arguments within the expression, so I decided to prettify the expression in the macro definition and the problem went away:
(at src/tail.jl)
When I execute this, for example (Jupyter Notebook):
I get the following error:
I suspected that it had something to do with LineNumberNode arguments within the expression, so I decided to prettify the expression in the macro definition and the problem went away:
(at src/tail.jl)
Still not sure what happened there...
The text was updated successfully, but these errors were encountered: