Skip to content

Commit

Permalink
protobuf: fix handling of delimited extensions in editions
Browse files Browse the repository at this point in the history
Change-Id: I5207e3e1d51e55147a7ec8374548aeb6a5312172
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/595337
Reviewed-by: Lasse Folger <[email protected]>
Reviewed-by: Michael Stapelberg <[email protected]>
Auto-Submit: Michael Stapelberg <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
  • Loading branch information
mkruskal-google authored and gopherbot committed Jul 2, 2024
1 parent d462176 commit eea33cd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/testprotos/testeditions/test_extension.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions reflect/protodesc/desc_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ func (r descsByName) initExtensionDeclarations(xds []*descriptorpb.FieldDescript
if xd.JsonName != nil {
x.L2.StringName.InitJSON(xd.GetJsonName())
}
if x.L1.Kind == protoreflect.MessageKind && x.L1.EditionFeatures.IsDelimitedEncoded {
x.L1.Kind = protoreflect.GroupKind
}
}
return xs, nil
}
Expand Down

0 comments on commit eea33cd

Please sign in to comment.