Skip to content
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

Incompatibility with kwdef macro #15

Closed
Tortar opened this issue Oct 10, 2023 · 1 comment · Fixed by #18
Closed

Incompatibility with kwdef macro #15

Tortar opened this issue Oct 10, 2023 · 1 comment · Fixed by #18

Comments

@Tortar
Copy link
Contributor

Tortar commented Oct 10, 2023

Currently this

@proto @kwdef struct A
           x::Int = 1
       end

throws

ERROR: LoadError: ArgumentError: Expected expression to be a type definition.
Stacktrace:
 [1] var"@proto"(__source__::LineNumberNode, __module__::Module, expr::Any)
   @ ProtoStructs ~/.julia/packages/ProtoStructs/4sIVY/src/ProtoStruct.jl:3
in expression starting at REPL[53]:1

I'm willing to solve the issue if you can give me some indication on how to solve this and if it isn't too hard :-)

@Tortar Tortar changed the title Compatibility with kwdef macro Incompatibility with kwdef macro Oct 10, 2023
@Tortar
Copy link
Contributor Author

Tortar commented Oct 11, 2023

Oh just saw one of your tests:

@proto mutable struct TestMutation{T, V <: Real}
    A::Int = 1
    B = :no
    C::T = nothing
    D::V
    E::String
end

so it should be enough maybe to ignore the kwdef macro

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