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

Error if attribute name "message" is used in a capnp struct definition #457

Closed
kfatehi opened this issue Feb 20, 2023 · 2 comments
Closed

Comments

@kfatehi
Copy link

kfatehi commented Feb 20, 2023

HI, thanks for the work on this library. I noticed what appears to be a bug. If I try to compile this file, this struct's "message" attribute causes the following error when trying to use the generated Go code later on.

cereal/gen/go/log.capnp.go:10674:26: AndroidLogEntry.Message redeclared in this block
        cereal/gen/go/log.capnp.go:10609:26: other declaration of Message

A quick workaround is naming it something else before generation

image

Would this be considered a bug in capnproto.org/go/capnp/v3 or bad practice by the author? I was unable to find a list of reserved words in the schema language, so I suspect this is sort of a de-facto reserved word if using capnproto.org/go/capnp/v3 at this point in time, correct?

Thanks!

@zenhack
Copy link
Contributor

zenhack commented Feb 20, 2023

Yeah, this is a known issue; see #46. Besides renaming the field itself you can use the $Go.name annotation.

I'm going to go ahead and close this as a duplicate of #46.

@zenhack zenhack closed this as completed Feb 20, 2023
@kfatehi
Copy link
Author

kfatehi commented Feb 20, 2023

thanks! ill try to search more carefully next time

kfatehi added a commit to comma-hacks/webrtc that referenced this issue Feb 20, 2023
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

No branches or pull requests

2 participants