protobuf-go/cmd/protoc-gen-go/testdata
Josh Humphries 3b8611b60b 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 <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cassondra Foesch <cfoesch@gmail.com>
Reviewed-by: Mike Kruskal <mkruskal@google.com>
Reviewed-by: Michael Stapelberg <stapelberg@google.com>
2024-06-06 08:04:46 +00:00
..
annotations all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
comments all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
extensions all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
fieldnames all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
import_public all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
imports all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
issue780_oneof_conflict all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
nopackage all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
proto2 all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
proto3 all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
protoeditions reflect/protoreflect: FieldDescriptor.Kind should never be GroupKind for maps or fields of map entry 2024-06-06 08:04:46 +00:00
retention all: replace interface{} by any now that we are on Go 1.21 2024-05-15 12:42:15 +00:00
gen_test.go
registry_test.go