Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error parsing function with return type annotation #11

Closed
domluna opened this issue Apr 11, 2021 · 2 comments
Closed

Error parsing function with return type annotation #11

domluna opened this issue Apr 11, 2021 · 2 comments

Comments

@domluna
Copy link

domluna commented Apr 11, 2021

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
Copy link
Owner

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
Copy link
Owner

should be fixed now, I'll close this first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants