Error parsing function with return type annotation
domluna opened this issue · 2 comments
domluna commented
julia> ex2 = @expr function f(x; a=10)::Int
return x
end
:(function f(x; a = 10)::Int
#= REPL[148]:1 =#
#= REPL[148]:2 =#
return x
end)
julia> JLFunction(ex2)
ERROR: expect function head expr expression, got f(x; a = 10)::Int.
Stacktrace:
[1] anlys_error(expect::String, got::Expr)
@ Expronicon ~/.julia/packages/Expronicon/RauF7/src/analysis.jl:89
[2] split_function_head(ex::Expr)
@ Expronicon ~/.julia/packages/Expronicon/RauF7/src/analysis.jl:391
[3] JLFunction(ex::Expr)
@ Expronicon ~/.julia/packages/Expronicon/RauF7/src/analysis.jl:504
[4] top-level scope
@ REPL[149]:1
Roger-luo commented
should be fixed by #12 , but since I'm releasing https://github.com/Roger-luo/ExproniconLite.jl I'd like to wait this new package gets release then backport the fix there.
FYI, to get the JLFunction
object, you can just write
ex2 = @expr JLFunction function f(x; a=10)::Int
return x
end
Roger-luo commented
should be fixed now, I'll close this first.