Skip to content

Incorrect capture of anonymous function with typed arguments #209

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

Closed
MilesCranmer opened this issue Apr 13, 2025 · 2 comments · Fixed by #210
Closed

Incorrect capture of anonymous function with typed arguments #209

MilesCranmer opened this issue Apr 13, 2025 · 2 comments · Fixed by #210

Comments

@MilesCranmer
Copy link
Contributor

This is Julia 1.11:

julia> using MacroTools: splitdef

julia> splitdef(:((a::Int; b=2) -> a + b))
ERROR: AssertionError: Not a function definition: begin
        a::Int
        #= REPL[3]:1 =#
        b = 2
    end->begin
        #= REPL[3]:1 =#
        a + b
    end
Stacktrace:
 [1] splitdef(fdef::Expr)
   @ MacroTools ~/.julia/packages/MacroTools/CJmbb/src/utils.jl:317
 [2] top-level scope
   @ REPL[3]:1
@MilesCranmer
Copy link
Contributor Author

I've got a fix! @cstjean. Want me to make a PR?

@MilesCranmer
Copy link
Contributor Author

@cstjean added in #210

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.

1 participant