Skip to content

Macroexpansion of @with_kw argument #154

@jkosata

Description

@jkosata

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions