Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reflect/protoreflect: FieldDescriptor.Kind should never be GroupKind …
…for maps or fields of map entry Resolves golang/protobuf#1615 The protoc compiler disallows setting the message encoding feature of map fields to delimited since maps, at least for now (as of edition 2023) should always use normal length-prefixed encoding. But the field (and a message value field inside the map entry) could inherit such a feature value if it were set as a file-wide default. At the point where the code changes the kind from message to group, based on the field's resolved features, the message type hasn't yet been resolved. So this change adds a check after the FieldDescriptor's message type is resolved, to change the kind back from group to message if the field is a map field or a field in a map entry message. Change-Id: I785269a4ecd80d1a17866c08b2afc0b01440e0e3 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/588976 Reviewed-by: Michael Knyszek <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Cassondra Foesch <[email protected]> Reviewed-by: Mike Kruskal <[email protected]> Reviewed-by: Michael Stapelberg <[email protected]>
- Loading branch information