Skip to content

Incorrect capture of anonymous function with typed arguments #209

Closed
@MilesCranmer

Description

@MilesCranmer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions