Fix name collision with "result" in pretty printing logic in generated proto code. #10169
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When generating the C++ code from the .proto files, it was discovered that if a proto message happens to have a field named "result", "header", or "tail" then the generated C++ code would fail to compile with an error like this:
The root cause was that the ToString() methods defined local variables named "result", "header", and "tail" which would collide with other local variable names created for the proto messages' fields if they were also coincidentally named "result", "header", or "tail".
The fix in this PR changes those local variable names to "tostring_result", "tostring_header", and "tostring_tail", respectively, to avoid such naming conflicts in the future. Admittedly, if a future proto message happens to have a field named "tostring_result", for example, then this problem will resurface; however, that seems like an unlikely scenario and we'll deal with that if it ever happens.
When reviewing this PR, the only file that was modified by hand was
Firestore/Protos/lib/pretty_printing.py
; all of the other changes in this PR are the regenerated C++ code from the .proto files.#no-changelog