Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/impl: skip synthetic oneofs in messageInfo
Calling WhichOneof should not be possible for synthetic oneofs; on the reflection level, these fields should work as if they were regular fields, not as if they were oneofs: > Reflection for proto3 optional fields should work properly. For example, a > method like Reflection::HasField() should know to look for the hasbit for a > proto3 optional field. It should not be fooled by the synthetic oneof into > thinking that there is a case member for the oneof. From the Protobuf docs at: https://github.com/protocolbuffers/protobuf/blob/main/docs/implementing_proto3_presence.md#updating-reflection This change was tested Google-internally as CL 701866153. Change-Id: Id9500d4aa492acf4ebc6d2d84be07ed81201d2aa Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/632735 Reviewed-by: Chressie Himpel <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
- Loading branch information