JuliaLang / AllocCheck.jl

AllocCheck
Other
209 stars 8 forks source link

@check_allocs interacts badly with splatted args and kwargs #52

Open tecosaur opened 8 months ago

tecosaur commented 8 months ago

I ran into a quick issue in one of the first few tests of @check_allocs I did. I think the MWE is pretty self-explanatory.

julia> @check_allocs g(args...; kwargs...) = f(args...; kwargs...)
ERROR: syntax: invalid "..." on non-final argument around /home/tec/.julia/packages/AllocCheck/xTVrb/src/macro.jl:153
Stacktrace:
 [1] top-level scope
   @ REPL[2]:1

Interestingly it seems fine if I only splat args or kwargs

julia> @check_allocs g(; kwargs...) = f(; kwargs...)
g (generic function with 1 method)

julia> @check_allocs g(args...) = f(args...)
g (generic function with 2 methods)