@@ -126,7 +126,7 @@ struct Apple_AppleParameters {
126126 set { _uniqueStorage ( ) . _merchantIdentifier = newValue}
127127 }
128128
129- var merchantCapabilities : Apple_MerchantCapabilities {
129+ var merchantCapabilities : [ Apple_MerchantCapabilities ] {
130130 get { return _storage. _merchantCapabilities}
131131 set { _uniqueStorage ( ) . _merchantCapabilities = newValue}
132132 }
@@ -355,7 +355,7 @@ extension Apple_AppleParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageIm
355355
356356 fileprivate class _StorageClass {
357357 var _merchantIdentifier : String = String ( )
358- var _merchantCapabilities : Apple_MerchantCapabilities = . threeds
358+ var _merchantCapabilities : [ Apple_MerchantCapabilities ] = [ ]
359359 var _supportedCountries : [ String ] = [ ]
360360 var _requiredBillingContactFields : [ String ] = [ ]
361361 var _requiredShippingContactFields : [ String ] = [ ]
@@ -399,7 +399,7 @@ extension Apple_AppleParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageIm
399399 // enabled. https://github.com/apple/swift-protobuf/issues/1034
400400 switch fieldNumber {
401401 case 1 : try { try decoder. decodeSingularStringField ( value: & _storage. _merchantIdentifier) } ( )
402- case 2 : try { try decoder. decodeSingularEnumField ( value: & _storage. _merchantCapabilities) } ( )
402+ case 2 : try { try decoder. decodeRepeatedEnumField ( value: & _storage. _merchantCapabilities) } ( )
403403 case 3 : try { try decoder. decodeRepeatedStringField ( value: & _storage. _supportedCountries) } ( )
404404 case 4 : try { try decoder. decodeRepeatedStringField ( value: & _storage. _requiredBillingContactFields) } ( )
405405 case 5 : try { try decoder. decodeRepeatedStringField ( value: & _storage. _requiredShippingContactFields) } ( )
@@ -416,11 +416,15 @@ extension Apple_AppleParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageIm
416416
417417 func traverse< V: SwiftProtobuf . Visitor > ( visitor: inout V ) throws {
418418 try withExtendedLifetime ( _storage) { ( _storage: _StorageClass ) in
419+ // The use of inline closures is to circumvent an issue where the compiler
420+ // allocates stack space for every if/case branch local when no optimizations
421+ // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
422+ // https://github.com/apple/swift-protobuf/issues/1182
419423 if !_storage. _merchantIdentifier. isEmpty {
420424 try visitor. visitSingularStringField ( value: _storage. _merchantIdentifier, fieldNumber: 1 )
421425 }
422- if _storage. _merchantCapabilities != . threeds {
423- try visitor. visitSingularEnumField ( value: _storage. _merchantCapabilities, fieldNumber: 2 )
426+ if ! _storage. _merchantCapabilities. isEmpty {
427+ try visitor. visitPackedEnumField ( value: _storage. _merchantCapabilities, fieldNumber: 2 )
424428 }
425429 if !_storage. _supportedCountries. isEmpty {
426430 try visitor. visitRepeatedStringField ( value: _storage. _supportedCountries, fieldNumber: 3 )
@@ -431,12 +435,12 @@ extension Apple_AppleParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageIm
431435 if !_storage. _requiredShippingContactFields. isEmpty {
432436 try visitor. visitRepeatedStringField ( value: _storage. _requiredShippingContactFields, fieldNumber: 5 )
433437 }
434- if let v = _storage. _billingContact {
438+ try { if let v = _storage. _billingContact {
435439 try visitor. visitSingularMessageField ( value: v, fieldNumber: 6 )
436- }
437- if let v = _storage. _shippingContact {
440+ } } ( )
441+ try { if let v = _storage. _shippingContact {
438442 try visitor. visitSingularMessageField ( value: v, fieldNumber: 7 )
439- }
443+ } } ( )
440444 if !_storage. _shippingMethods. isEmpty {
441445 try visitor. visitRepeatedMessageField ( value: _storage. _shippingMethods, fieldNumber: 8 )
442446 }
@@ -499,18 +503,22 @@ extension Apple_Contact: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementa
499503 }
500504
501505 func traverse< V: SwiftProtobuf . Visitor > ( visitor: inout V ) throws {
506+ // The use of inline closures is to circumvent an issue where the compiler
507+ // allocates stack space for every if/case branch local when no optimizations
508+ // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
509+ // https://github.com/apple/swift-protobuf/issues/1182
502510 if !self . emailAddress. isEmpty {
503511 try visitor. visitSingularStringField ( value: self . emailAddress, fieldNumber: 1 )
504512 }
505- if let v = self . _name {
513+ try { if let v = self . _name {
506514 try visitor. visitSingularMessageField ( value: v, fieldNumber: 2 )
507- }
515+ } } ( )
508516 if !self . phoneNumber. isEmpty {
509517 try visitor. visitSingularStringField ( value: self . phoneNumber, fieldNumber: 3 )
510518 }
511- if let v = self . _postalAddress {
519+ try { if let v = self . _postalAddress {
512520 try visitor. visitSingularMessageField ( value: v, fieldNumber: 4 )
513- }
521+ } } ( )
514522 try unknownFields. traverse ( visitor: & visitor)
515523 }
516524
@@ -590,6 +598,10 @@ extension Apple_PersonNameComponents: SwiftProtobuf.Message, SwiftProtobuf._Mess
590598
591599 func traverse< V: SwiftProtobuf . Visitor > ( visitor: inout V ) throws {
592600 try withExtendedLifetime ( _storage) { ( _storage: _StorageClass ) in
601+ // The use of inline closures is to circumvent an issue where the compiler
602+ // allocates stack space for every if/case branch local when no optimizations
603+ // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
604+ // https://github.com/apple/swift-protobuf/issues/1182
593605 if !_storage. _namePrefix. isEmpty {
594606 try visitor. visitSingularStringField ( value: _storage. _namePrefix, fieldNumber: 1 )
595607 }
@@ -608,9 +620,9 @@ extension Apple_PersonNameComponents: SwiftProtobuf.Message, SwiftProtobuf._Mess
608620 if !_storage. _nickname. isEmpty {
609621 try visitor. visitSingularStringField ( value: _storage. _nickname, fieldNumber: 6 )
610622 }
611- if let v = _storage. _phoneticRepresentation {
623+ try { if let v = _storage. _phoneticRepresentation {
612624 try visitor. visitSingularMessageField ( value: v, fieldNumber: 7 )
613- }
625+ } } ( )
614626 }
615627 try unknownFields. traverse ( visitor: & visitor)
616628 }
0 commit comments