Open jkosata opened 1 year ago
I am experimenting with macros that define a struct. Here's an MWE of my problem:
using Parameters macro structmacro() return quote struct mystruct; myfield::Int; end end end @with_kw @structmacro
gives
ERROR: LoadError: @with_kw only supported for types which have at least one field.
Seems that @with_kw does not expand @structmacro into a struct declaration. The solution is probably analogous to #21
@with_kw
@structmacro
Turns out expanding :macrocall and :block expressions in with_kw does the trick here. Submitting a pull request as I need this functionality for https://github.com/jkosata/DefaultFields.jl
:macrocall
:block
with_kw
I am experimenting with macros that define a struct. Here's an MWE of my problem:
gives
Seems that
@with_kw
does not expand@structmacro
into a struct declaration. The solution is probably analogous to #21