We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
m
What version of protobuf and what language are you using? Version: v3.19.6 - latest 3.20 and 3.21 are impacted as well. Language: Java
What operating system (Linux, Windows, ...) and version? Linux
What runtime / compiler are you using (e.g., python version or gcc version) OpenJDK 11
What did you do?
The following proto leads to a Java code that doesn't compile:
syntax = "proto2"; package m; message Foo {} message Msg { repeated Foo foo = 1; }
Error:
[error] Test.java:862:1: cannot find symbol [error] symbol: variable Test [error] location: variable m of type m.Test.Foo
The breakage appears to have been introduced in this change: https://github.com/protocolbuffers/protobuf/pull/10667/files#diff-1f7aa0e2fe4f343ea4da9e797d4e55c69af1ee6a7778ea5aafc2f0a35195a646R1310-R1316 - where the variable used is m rather than $name_ which was meant to resolve name clashes. I know a package named name m is quite contrived, but maybe there are additional scenarios where this change could lead to name clashes. This issue was discovered by ScalaPB's test framework which generates random protocol buffers.
$name_
The text was updated successfully, but these errors were encountered:
Yeah. We have a number of these kinds of problems with generated names. We need a better strategy for making naming collisions less likely.
Sorry, something went wrong.
googleberg
No branches or pull requests
What version of protobuf and what language are you using?
Version: v3.19.6 - latest 3.20 and 3.21 are impacted as well.
Language: Java
What operating system (Linux, Windows, ...) and version?
Linux
What runtime / compiler are you using (e.g., python version or gcc version)
OpenJDK 11
What did you do?
The following proto leads to a Java code that doesn't compile:
Error:
The breakage appears to have been introduced in this change: https://github.com/protocolbuffers/protobuf/pull/10667/files#diff-1f7aa0e2fe4f343ea4da9e797d4e55c69af1ee6a7778ea5aafc2f0a35195a646R1310-R1316 - where the variable used is
m
rather than$name_
which was meant to resolve name clashes. I know a package named namem
is quite contrived, but maybe there are additional scenarios where this change could lead to name clashes. This issue was discovered by ScalaPB's test framework which generates random protocol buffers.The text was updated successfully, but these errors were encountered: