mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-03-09 22:13:27 +00:00
editions: minor fix to resolve editions features correctly
+ 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 <stapelberg@google.com> Auto-Submit: Lasse Folger <lassefolger@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
9e454d6514
commit
b70f02be53
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user