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
namespace resolution different from protoc behavior #314
Closed
Labels
Bug
Something isn't working
Comments
Just an update: we're working on it :-) |
Merged
This is fixed and will go out in the next release. Thanks for reporting the issue! |
We had to revert the fix for this as it caused a different bug - we'll get that fixed, and then re-add this in a new release, our apologies. |
This should be fixed now in 0.43.2. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider the following proto:
Note that this proto package is
com.google
and the imported package isgoogle.protobuf
.When using the type
google.protobuf.StringValue
, according to protobuf namespace resolution rules, it should look for theStringValue
type insidecom.google.protobuf
. This means the above proto file should fail inprotoc
and indeed it fails with the following message:)
In order to fix this, I need to use
.google.protobuf.StringValue str = 1;
(notice that dot prefix)The problem is that
buf
, on the other hand, considers the above to be correct in both cases (with or without a leading.
):(notice how the typename is resolved to
.google.protobuf.StringValue
)Important: This is not an edge case caused by the usage of google in
package com.google
.It's an issue with namespace resolution that could occur also if the file was in
com.xyz
and there was another file with packagexyz.something.else
The text was updated successfully, but these errors were encountered: