-
Notifications
You must be signed in to change notification settings - Fork 19
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
Invalid code generation for top-level singletons #310
Comments
The `fmt` and `strings` packages are imported but not used, resulting in compilation errors. Closes einride#310
The `fmt` and `strings` packages are imported but not used, resulting in compile errors. Closes einride#310
Hi @vallahaye , thanks for your report and sorry for the delay! In AIP-156, it says:
I wonder if this means that top-level singletons aren't allowed in general. WDYT? Anwyay, I don't think we should generate broken code, and it should be up to the user to follow this rule, so I'll review your PR shortly! |
Well, I think we're in undefined territory here. While it's not strictly forbidden, I haven't found a single sentence that describes singleton resources without referring to a parent. On the other hand, I can definitely see a use case for a top-level configuration singleton in the management plane (which is what led to me opening this issue). |
It seems that the code generated for top-level singletons with
[email protected]
is invalid. Specifically, thefmt
andstrings
packages are imported but not used, resulting in compile errors.For example, the following proto:
generates the following code:
which, when compiled, produces the following errors:
The text was updated successfully, but these errors were encountered: