File tree 1 file changed +10
-2
lines changed
Sources/SwiftProtobufPluginLibrary
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1092,7 +1092,15 @@ public final class FieldDescriptor {
1092
1092
/// This should never be called directly. Use isRequired and isRepeated
1093
1093
/// helper methods instead.
1094
1094
@available ( * , deprecated, message: " Use isRequired or isRepeated instead. " )
1095
- public var label : Google_Protobuf_FieldDescriptorProto . Label { _label }
1095
+ public var label : Google_Protobuf_FieldDescriptorProto . Label {
1096
+ if isRepeated {
1097
+ return . repeated
1098
+ } else if isRequired {
1099
+ return . required
1100
+ } else {
1101
+ return . optional
1102
+ }
1103
+ }
1096
1104
1097
1105
// Storage for `label`, used by other apis.
1098
1106
private var _label : Google_Protobuf_FieldDescriptorProto . Label
@@ -1132,7 +1140,7 @@ public final class FieldDescriptor {
1132
1140
var _hasOptionalKeyword : Bool {
1133
1141
// This logic comes from the C++ FieldDescriptor::has_optional_keyword()
1134
1142
// impl.
1135
- proto3Optional || ( file. edition == . proto2 && _label == . optional && oneofIndex == nil )
1143
+ proto3Optional || ( file. edition == . proto2 && !isRequired && !isRepeated && oneofIndex == nil )
1136
1144
}
1137
1145
@available ( * , deprecated, message: " Please open a GitHub issue if you think functionality is missing. " )
1138
1146
public var hasOptionalKeyword : Bool {
You can’t perform that action at this time.
0 commit comments