-
Notifications
You must be signed in to change notification settings - Fork 989
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
Fix name collision in program proto #3949
Fix name collision in program proto #3949
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO(95-martin-orion): Update #3923 with these changes.
@@ -276,25 +276,25 @@ message MeasurementKey { | |||
// swap measurement keys a and b. | |||
message MeasurementKeyMapping { | |||
// Indicates that measurement key "key" should be replaced with "value". | |||
message Entry { | |||
message MeasurementKeyEntry { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, the other two should be QubitEntry
and ArgEntry
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh good point with the consistency - I would call this instead MeasurementKeyMappingEntry
then...? Too long?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for QubitEntry
, ArgEntry
, MeasurementKeyEntry
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Echoing @maffoo: these will always appear as *Mapping.<name>
. We only need enough prefix to dedupe these types, so I also prefer *Entry
instead of *MappingEntry
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha, fixing!
Too bad that discovery api generation doesn't respect nested messages. This would seem to me to be a common problem; is there any way to change the discovery API generation to deal with this? |
IIRC, there's a similar restriction on enums in protos: even when nested, they can't have the same name. I suspect this has more to do with the fundamental behavior of protos than our API generation tools. |
Fix name collision in program proto around
Entry
-s (causes a name collision in the discovery API generation in g3).