Skip to content

Commit

Permalink
editions: minor fix to resolve editions features correctly
Browse files Browse the repository at this point in the history
+ The previous commit forgot to resolve the LegacyRequired feature

Change-Id: I05a2847be3d52277c65df004363ea3c87944364e
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/555976
Reviewed-by: Michael Stapelberg <[email protected]>
Auto-Submit: Lasse Folger <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
  • Loading branch information
lfolger authored and gopherbot committed Jan 16, 2024
1 parent 9e454d6 commit b70f02b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/filedesc/desc.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ type (
// IsFieldPresence is true if field_presence is EXPLICIT
// https://protobuf.dev/editions/features/#field_presence
IsFieldPresence bool
// IsFieldPresence is true if field_presence is LEGACY_REQUIRED
// https://protobuf.dev/editions/features/#field_presence
IsLegacyRequired bool
// IsOpenEnum is true if enum_type is OPEN
// https://protobuf.dev/editions/features/#enum_type
IsOpenEnum bool
Expand Down
1 change: 1 addition & 0 deletions reflect/protodesc/editions.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ func mergeEditionFeatures(parentDesc protoreflect.Descriptor, child *descriptorp
if fp := child.FieldPresence; fp != nil {
parentFS.IsFieldPresence = *fp == descriptorpb.FeatureSet_LEGACY_REQUIRED ||
*fp == descriptorpb.FeatureSet_EXPLICIT
parentFS.IsLegacyRequired = *fp == descriptorpb.FeatureSet_LEGACY_REQUIRED
}
if et := child.EnumType; et != nil {
parentFS.IsOpenEnum = *et == descriptorpb.FeatureSet_OPEN
Expand Down

0 comments on commit b70f02b

Please sign in to comment.