unittest_proto3_arena.pb.swift 88 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951
  1. // DO NOT EDIT.
  2. // swift-format-ignore-file
  3. // swiftlint:disable all
  4. //
  5. // Generated by the Swift generator plugin for the protocol buffer compiler.
  6. // Source: google/protobuf/unittest_proto3_arena.proto
  7. //
  8. // For information on using the generated types, please see the documentation:
  9. // https://github.com/apple/swift-protobuf/
  10. // Protocol Buffers - Google's data interchange format
  11. // Copyright 2008 Google Inc. All rights reserved.
  12. //
  13. // Use of this source code is governed by a BSD-style
  14. // license that can be found in the LICENSE file or at
  15. // https://developers.google.com/open-source/licenses/bsd
  16. import Foundation
  17. import SwiftProtobuf
  18. // If the compiler emits an error on this type, it is because this file
  19. // was generated by a version of the `protoc` Swift plug-in that is
  20. // incompatible with the version of SwiftProtobuf to which you are linking.
  21. // Please ensure that you are building against the same version of the API
  22. // that was used to generate this file.
  23. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  24. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  25. typealias Version = _2
  26. }
  27. enum Proto3ArenaUnittest_ForeignEnum: SwiftProtobuf.Enum, Swift.CaseIterable {
  28. typealias RawValue = Int
  29. case foreignZero // = 0
  30. case foreignFoo // = 4
  31. case foreignBar // = 5
  32. case foreignBaz // = 6
  33. /// Large enough to escape the Boxed Integer cache.
  34. case foreignLarge // = 123456
  35. case UNRECOGNIZED(Int)
  36. init() {
  37. self = .foreignZero
  38. }
  39. init?(rawValue: Int) {
  40. switch rawValue {
  41. case 0: self = .foreignZero
  42. case 4: self = .foreignFoo
  43. case 5: self = .foreignBar
  44. case 6: self = .foreignBaz
  45. case 123456: self = .foreignLarge
  46. default: self = .UNRECOGNIZED(rawValue)
  47. }
  48. }
  49. var rawValue: Int {
  50. switch self {
  51. case .foreignZero: return 0
  52. case .foreignFoo: return 4
  53. case .foreignBar: return 5
  54. case .foreignBaz: return 6
  55. case .foreignLarge: return 123456
  56. case .UNRECOGNIZED(let i): return i
  57. }
  58. }
  59. // The compiler won't synthesize support with the UNRECOGNIZED case.
  60. static let allCases: [Proto3ArenaUnittest_ForeignEnum] = [
  61. .foreignZero,
  62. .foreignFoo,
  63. .foreignBar,
  64. .foreignBaz,
  65. .foreignLarge,
  66. ]
  67. }
  68. /// This proto includes every type of field in both singular and repeated
  69. /// forms.
  70. struct Proto3ArenaUnittest_TestAllTypes: @unchecked Sendable {
  71. // SwiftProtobuf.Message conformance is added in an extension below. See the
  72. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  73. // methods supported on all messages.
  74. /// Singular
  75. var optionalInt32: Int32 {
  76. get {return _storage._optionalInt32}
  77. set {_uniqueStorage()._optionalInt32 = newValue}
  78. }
  79. var optionalInt64: Int64 {
  80. get {return _storage._optionalInt64}
  81. set {_uniqueStorage()._optionalInt64 = newValue}
  82. }
  83. var optionalUint32: UInt32 {
  84. get {return _storage._optionalUint32}
  85. set {_uniqueStorage()._optionalUint32 = newValue}
  86. }
  87. var optionalUint64: UInt64 {
  88. get {return _storage._optionalUint64}
  89. set {_uniqueStorage()._optionalUint64 = newValue}
  90. }
  91. var optionalSint32: Int32 {
  92. get {return _storage._optionalSint32}
  93. set {_uniqueStorage()._optionalSint32 = newValue}
  94. }
  95. var optionalSint64: Int64 {
  96. get {return _storage._optionalSint64}
  97. set {_uniqueStorage()._optionalSint64 = newValue}
  98. }
  99. var optionalFixed32: UInt32 {
  100. get {return _storage._optionalFixed32}
  101. set {_uniqueStorage()._optionalFixed32 = newValue}
  102. }
  103. var optionalFixed64: UInt64 {
  104. get {return _storage._optionalFixed64}
  105. set {_uniqueStorage()._optionalFixed64 = newValue}
  106. }
  107. var optionalSfixed32: Int32 {
  108. get {return _storage._optionalSfixed32}
  109. set {_uniqueStorage()._optionalSfixed32 = newValue}
  110. }
  111. var optionalSfixed64: Int64 {
  112. get {return _storage._optionalSfixed64}
  113. set {_uniqueStorage()._optionalSfixed64 = newValue}
  114. }
  115. var optionalFloat: Float {
  116. get {return _storage._optionalFloat}
  117. set {_uniqueStorage()._optionalFloat = newValue}
  118. }
  119. var optionalDouble: Double {
  120. get {return _storage._optionalDouble}
  121. set {_uniqueStorage()._optionalDouble = newValue}
  122. }
  123. var optionalBool: Bool {
  124. get {return _storage._optionalBool}
  125. set {_uniqueStorage()._optionalBool = newValue}
  126. }
  127. var optionalString: String {
  128. get {return _storage._optionalString}
  129. set {_uniqueStorage()._optionalString = newValue}
  130. }
  131. var optionalBytes: Data {
  132. get {return _storage._optionalBytes}
  133. set {_uniqueStorage()._optionalBytes = newValue}
  134. }
  135. var optionalNestedMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage {
  136. get {return _storage._optionalNestedMessage ?? Proto3ArenaUnittest_TestAllTypes.NestedMessage()}
  137. set {_uniqueStorage()._optionalNestedMessage = newValue}
  138. }
  139. /// Returns true if `optionalNestedMessage` has been explicitly set.
  140. var hasOptionalNestedMessage: Bool {return _storage._optionalNestedMessage != nil}
  141. /// Clears the value of `optionalNestedMessage`. Subsequent reads from it will return its default value.
  142. mutating func clearOptionalNestedMessage() {_uniqueStorage()._optionalNestedMessage = nil}
  143. var optionalForeignMessage: Proto3ArenaUnittest_ForeignMessage {
  144. get {return _storage._optionalForeignMessage ?? Proto3ArenaUnittest_ForeignMessage()}
  145. set {_uniqueStorage()._optionalForeignMessage = newValue}
  146. }
  147. /// Returns true if `optionalForeignMessage` has been explicitly set.
  148. var hasOptionalForeignMessage: Bool {return _storage._optionalForeignMessage != nil}
  149. /// Clears the value of `optionalForeignMessage`. Subsequent reads from it will return its default value.
  150. mutating func clearOptionalForeignMessage() {_uniqueStorage()._optionalForeignMessage = nil}
  151. var optionalImportMessage: Proto2UnittestImport_ImportMessage {
  152. get {return _storage._optionalImportMessage ?? Proto2UnittestImport_ImportMessage()}
  153. set {_uniqueStorage()._optionalImportMessage = newValue}
  154. }
  155. /// Returns true if `optionalImportMessage` has been explicitly set.
  156. var hasOptionalImportMessage: Bool {return _storage._optionalImportMessage != nil}
  157. /// Clears the value of `optionalImportMessage`. Subsequent reads from it will return its default value.
  158. mutating func clearOptionalImportMessage() {_uniqueStorage()._optionalImportMessage = nil}
  159. var optionalNestedEnum: Proto3ArenaUnittest_TestAllTypes.NestedEnum {
  160. get {return _storage._optionalNestedEnum}
  161. set {_uniqueStorage()._optionalNestedEnum = newValue}
  162. }
  163. var optionalForeignEnum: Proto3ArenaUnittest_ForeignEnum {
  164. get {return _storage._optionalForeignEnum}
  165. set {_uniqueStorage()._optionalForeignEnum = newValue}
  166. }
  167. var optionalStringPiece: String {
  168. get {return _storage._optionalStringPiece}
  169. set {_uniqueStorage()._optionalStringPiece = newValue}
  170. }
  171. var optionalCord: String {
  172. get {return _storage._optionalCord}
  173. set {_uniqueStorage()._optionalCord = newValue}
  174. }
  175. var optionalBytesCord: Data {
  176. get {return _storage._optionalBytesCord}
  177. set {_uniqueStorage()._optionalBytesCord = newValue}
  178. }
  179. /// Defined in unittest_import_public.proto
  180. var optionalPublicImportMessage: Proto2UnittestImport_PublicImportMessage {
  181. get {return _storage._optionalPublicImportMessage ?? Proto2UnittestImport_PublicImportMessage()}
  182. set {_uniqueStorage()._optionalPublicImportMessage = newValue}
  183. }
  184. /// Returns true if `optionalPublicImportMessage` has been explicitly set.
  185. var hasOptionalPublicImportMessage: Bool {return _storage._optionalPublicImportMessage != nil}
  186. /// Clears the value of `optionalPublicImportMessage`. Subsequent reads from it will return its default value.
  187. mutating func clearOptionalPublicImportMessage() {_uniqueStorage()._optionalPublicImportMessage = nil}
  188. var optionalLazyMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage {
  189. get {return _storage._optionalLazyMessage ?? Proto3ArenaUnittest_TestAllTypes.NestedMessage()}
  190. set {_uniqueStorage()._optionalLazyMessage = newValue}
  191. }
  192. /// Returns true if `optionalLazyMessage` has been explicitly set.
  193. var hasOptionalLazyMessage: Bool {return _storage._optionalLazyMessage != nil}
  194. /// Clears the value of `optionalLazyMessage`. Subsequent reads from it will return its default value.
  195. mutating func clearOptionalLazyMessage() {_uniqueStorage()._optionalLazyMessage = nil}
  196. var optionalUnverifiedLazyMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage {
  197. get {return _storage._optionalUnverifiedLazyMessage ?? Proto3ArenaUnittest_TestAllTypes.NestedMessage()}
  198. set {_uniqueStorage()._optionalUnverifiedLazyMessage = newValue}
  199. }
  200. /// Returns true if `optionalUnverifiedLazyMessage` has been explicitly set.
  201. var hasOptionalUnverifiedLazyMessage: Bool {return _storage._optionalUnverifiedLazyMessage != nil}
  202. /// Clears the value of `optionalUnverifiedLazyMessage`. Subsequent reads from it will return its default value.
  203. mutating func clearOptionalUnverifiedLazyMessage() {_uniqueStorage()._optionalUnverifiedLazyMessage = nil}
  204. var optionalLazyImportMessage: Proto2UnittestImport_ImportMessage {
  205. get {return _storage._optionalLazyImportMessage ?? Proto2UnittestImport_ImportMessage()}
  206. set {_uniqueStorage()._optionalLazyImportMessage = newValue}
  207. }
  208. /// Returns true if `optionalLazyImportMessage` has been explicitly set.
  209. var hasOptionalLazyImportMessage: Bool {return _storage._optionalLazyImportMessage != nil}
  210. /// Clears the value of `optionalLazyImportMessage`. Subsequent reads from it will return its default value.
  211. mutating func clearOptionalLazyImportMessage() {_uniqueStorage()._optionalLazyImportMessage = nil}
  212. /// Repeated
  213. var repeatedInt32: [Int32] {
  214. get {return _storage._repeatedInt32}
  215. set {_uniqueStorage()._repeatedInt32 = newValue}
  216. }
  217. var repeatedInt64: [Int64] {
  218. get {return _storage._repeatedInt64}
  219. set {_uniqueStorage()._repeatedInt64 = newValue}
  220. }
  221. var repeatedUint32: [UInt32] {
  222. get {return _storage._repeatedUint32}
  223. set {_uniqueStorage()._repeatedUint32 = newValue}
  224. }
  225. var repeatedUint64: [UInt64] {
  226. get {return _storage._repeatedUint64}
  227. set {_uniqueStorage()._repeatedUint64 = newValue}
  228. }
  229. var repeatedSint32: [Int32] {
  230. get {return _storage._repeatedSint32}
  231. set {_uniqueStorage()._repeatedSint32 = newValue}
  232. }
  233. var repeatedSint64: [Int64] {
  234. get {return _storage._repeatedSint64}
  235. set {_uniqueStorage()._repeatedSint64 = newValue}
  236. }
  237. var repeatedFixed32: [UInt32] {
  238. get {return _storage._repeatedFixed32}
  239. set {_uniqueStorage()._repeatedFixed32 = newValue}
  240. }
  241. var repeatedFixed64: [UInt64] {
  242. get {return _storage._repeatedFixed64}
  243. set {_uniqueStorage()._repeatedFixed64 = newValue}
  244. }
  245. var repeatedSfixed32: [Int32] {
  246. get {return _storage._repeatedSfixed32}
  247. set {_uniqueStorage()._repeatedSfixed32 = newValue}
  248. }
  249. var repeatedSfixed64: [Int64] {
  250. get {return _storage._repeatedSfixed64}
  251. set {_uniqueStorage()._repeatedSfixed64 = newValue}
  252. }
  253. var repeatedFloat: [Float] {
  254. get {return _storage._repeatedFloat}
  255. set {_uniqueStorage()._repeatedFloat = newValue}
  256. }
  257. var repeatedDouble: [Double] {
  258. get {return _storage._repeatedDouble}
  259. set {_uniqueStorage()._repeatedDouble = newValue}
  260. }
  261. var repeatedBool: [Bool] {
  262. get {return _storage._repeatedBool}
  263. set {_uniqueStorage()._repeatedBool = newValue}
  264. }
  265. var repeatedString: [String] {
  266. get {return _storage._repeatedString}
  267. set {_uniqueStorage()._repeatedString = newValue}
  268. }
  269. var repeatedBytes: [Data] {
  270. get {return _storage._repeatedBytes}
  271. set {_uniqueStorage()._repeatedBytes = newValue}
  272. }
  273. /// Optional
  274. var proto3OptionalInt32: Int32 {
  275. get {return _storage._proto3OptionalInt32 ?? 0}
  276. set {_uniqueStorage()._proto3OptionalInt32 = newValue}
  277. }
  278. /// Returns true if `proto3OptionalInt32` has been explicitly set.
  279. var hasProto3OptionalInt32: Bool {return _storage._proto3OptionalInt32 != nil}
  280. /// Clears the value of `proto3OptionalInt32`. Subsequent reads from it will return its default value.
  281. mutating func clearProto3OptionalInt32() {_uniqueStorage()._proto3OptionalInt32 = nil}
  282. var proto3OptionalInt64: Int64 {
  283. get {return _storage._proto3OptionalInt64 ?? 0}
  284. set {_uniqueStorage()._proto3OptionalInt64 = newValue}
  285. }
  286. /// Returns true if `proto3OptionalInt64` has been explicitly set.
  287. var hasProto3OptionalInt64: Bool {return _storage._proto3OptionalInt64 != nil}
  288. /// Clears the value of `proto3OptionalInt64`. Subsequent reads from it will return its default value.
  289. mutating func clearProto3OptionalInt64() {_uniqueStorage()._proto3OptionalInt64 = nil}
  290. var proto3OptionalUint32: UInt32 {
  291. get {return _storage._proto3OptionalUint32 ?? 0}
  292. set {_uniqueStorage()._proto3OptionalUint32 = newValue}
  293. }
  294. /// Returns true if `proto3OptionalUint32` has been explicitly set.
  295. var hasProto3OptionalUint32: Bool {return _storage._proto3OptionalUint32 != nil}
  296. /// Clears the value of `proto3OptionalUint32`. Subsequent reads from it will return its default value.
  297. mutating func clearProto3OptionalUint32() {_uniqueStorage()._proto3OptionalUint32 = nil}
  298. var proto3OptionalUint64: UInt64 {
  299. get {return _storage._proto3OptionalUint64 ?? 0}
  300. set {_uniqueStorage()._proto3OptionalUint64 = newValue}
  301. }
  302. /// Returns true if `proto3OptionalUint64` has been explicitly set.
  303. var hasProto3OptionalUint64: Bool {return _storage._proto3OptionalUint64 != nil}
  304. /// Clears the value of `proto3OptionalUint64`. Subsequent reads from it will return its default value.
  305. mutating func clearProto3OptionalUint64() {_uniqueStorage()._proto3OptionalUint64 = nil}
  306. var proto3OptionalSint32: Int32 {
  307. get {return _storage._proto3OptionalSint32 ?? 0}
  308. set {_uniqueStorage()._proto3OptionalSint32 = newValue}
  309. }
  310. /// Returns true if `proto3OptionalSint32` has been explicitly set.
  311. var hasProto3OptionalSint32: Bool {return _storage._proto3OptionalSint32 != nil}
  312. /// Clears the value of `proto3OptionalSint32`. Subsequent reads from it will return its default value.
  313. mutating func clearProto3OptionalSint32() {_uniqueStorage()._proto3OptionalSint32 = nil}
  314. var proto3OptionalSint64: Int64 {
  315. get {return _storage._proto3OptionalSint64 ?? 0}
  316. set {_uniqueStorage()._proto3OptionalSint64 = newValue}
  317. }
  318. /// Returns true if `proto3OptionalSint64` has been explicitly set.
  319. var hasProto3OptionalSint64: Bool {return _storage._proto3OptionalSint64 != nil}
  320. /// Clears the value of `proto3OptionalSint64`. Subsequent reads from it will return its default value.
  321. mutating func clearProto3OptionalSint64() {_uniqueStorage()._proto3OptionalSint64 = nil}
  322. var proto3OptionalFixed32: UInt32 {
  323. get {return _storage._proto3OptionalFixed32 ?? 0}
  324. set {_uniqueStorage()._proto3OptionalFixed32 = newValue}
  325. }
  326. /// Returns true if `proto3OptionalFixed32` has been explicitly set.
  327. var hasProto3OptionalFixed32: Bool {return _storage._proto3OptionalFixed32 != nil}
  328. /// Clears the value of `proto3OptionalFixed32`. Subsequent reads from it will return its default value.
  329. mutating func clearProto3OptionalFixed32() {_uniqueStorage()._proto3OptionalFixed32 = nil}
  330. var proto3OptionalFixed64: UInt64 {
  331. get {return _storage._proto3OptionalFixed64 ?? 0}
  332. set {_uniqueStorage()._proto3OptionalFixed64 = newValue}
  333. }
  334. /// Returns true if `proto3OptionalFixed64` has been explicitly set.
  335. var hasProto3OptionalFixed64: Bool {return _storage._proto3OptionalFixed64 != nil}
  336. /// Clears the value of `proto3OptionalFixed64`. Subsequent reads from it will return its default value.
  337. mutating func clearProto3OptionalFixed64() {_uniqueStorage()._proto3OptionalFixed64 = nil}
  338. var proto3OptionalSfixed32: Int32 {
  339. get {return _storage._proto3OptionalSfixed32 ?? 0}
  340. set {_uniqueStorage()._proto3OptionalSfixed32 = newValue}
  341. }
  342. /// Returns true if `proto3OptionalSfixed32` has been explicitly set.
  343. var hasProto3OptionalSfixed32: Bool {return _storage._proto3OptionalSfixed32 != nil}
  344. /// Clears the value of `proto3OptionalSfixed32`. Subsequent reads from it will return its default value.
  345. mutating func clearProto3OptionalSfixed32() {_uniqueStorage()._proto3OptionalSfixed32 = nil}
  346. var proto3OptionalSfixed64: Int64 {
  347. get {return _storage._proto3OptionalSfixed64 ?? 0}
  348. set {_uniqueStorage()._proto3OptionalSfixed64 = newValue}
  349. }
  350. /// Returns true if `proto3OptionalSfixed64` has been explicitly set.
  351. var hasProto3OptionalSfixed64: Bool {return _storage._proto3OptionalSfixed64 != nil}
  352. /// Clears the value of `proto3OptionalSfixed64`. Subsequent reads from it will return its default value.
  353. mutating func clearProto3OptionalSfixed64() {_uniqueStorage()._proto3OptionalSfixed64 = nil}
  354. var proto3OptionalFloat: Float {
  355. get {return _storage._proto3OptionalFloat ?? 0}
  356. set {_uniqueStorage()._proto3OptionalFloat = newValue}
  357. }
  358. /// Returns true if `proto3OptionalFloat` has been explicitly set.
  359. var hasProto3OptionalFloat: Bool {return _storage._proto3OptionalFloat != nil}
  360. /// Clears the value of `proto3OptionalFloat`. Subsequent reads from it will return its default value.
  361. mutating func clearProto3OptionalFloat() {_uniqueStorage()._proto3OptionalFloat = nil}
  362. var proto3OptionalDouble: Double {
  363. get {return _storage._proto3OptionalDouble ?? 0}
  364. set {_uniqueStorage()._proto3OptionalDouble = newValue}
  365. }
  366. /// Returns true if `proto3OptionalDouble` has been explicitly set.
  367. var hasProto3OptionalDouble: Bool {return _storage._proto3OptionalDouble != nil}
  368. /// Clears the value of `proto3OptionalDouble`. Subsequent reads from it will return its default value.
  369. mutating func clearProto3OptionalDouble() {_uniqueStorage()._proto3OptionalDouble = nil}
  370. var proto3OptionalBool: Bool {
  371. get {return _storage._proto3OptionalBool ?? false}
  372. set {_uniqueStorage()._proto3OptionalBool = newValue}
  373. }
  374. /// Returns true if `proto3OptionalBool` has been explicitly set.
  375. var hasProto3OptionalBool: Bool {return _storage._proto3OptionalBool != nil}
  376. /// Clears the value of `proto3OptionalBool`. Subsequent reads from it will return its default value.
  377. mutating func clearProto3OptionalBool() {_uniqueStorage()._proto3OptionalBool = nil}
  378. var proto3OptionalString: String {
  379. get {return _storage._proto3OptionalString ?? String()}
  380. set {_uniqueStorage()._proto3OptionalString = newValue}
  381. }
  382. /// Returns true if `proto3OptionalString` has been explicitly set.
  383. var hasProto3OptionalString: Bool {return _storage._proto3OptionalString != nil}
  384. /// Clears the value of `proto3OptionalString`. Subsequent reads from it will return its default value.
  385. mutating func clearProto3OptionalString() {_uniqueStorage()._proto3OptionalString = nil}
  386. var proto3OptionalBytes: Data {
  387. get {return _storage._proto3OptionalBytes ?? Data()}
  388. set {_uniqueStorage()._proto3OptionalBytes = newValue}
  389. }
  390. /// Returns true if `proto3OptionalBytes` has been explicitly set.
  391. var hasProto3OptionalBytes: Bool {return _storage._proto3OptionalBytes != nil}
  392. /// Clears the value of `proto3OptionalBytes`. Subsequent reads from it will return its default value.
  393. mutating func clearProto3OptionalBytes() {_uniqueStorage()._proto3OptionalBytes = nil}
  394. var repeatedNestedMessage: [Proto3ArenaUnittest_TestAllTypes.NestedMessage] {
  395. get {return _storage._repeatedNestedMessage}
  396. set {_uniqueStorage()._repeatedNestedMessage = newValue}
  397. }
  398. var repeatedForeignMessage: [Proto3ArenaUnittest_ForeignMessage] {
  399. get {return _storage._repeatedForeignMessage}
  400. set {_uniqueStorage()._repeatedForeignMessage = newValue}
  401. }
  402. var repeatedImportMessage: [Proto2UnittestImport_ImportMessage] {
  403. get {return _storage._repeatedImportMessage}
  404. set {_uniqueStorage()._repeatedImportMessage = newValue}
  405. }
  406. var repeatedNestedEnum: [Proto3ArenaUnittest_TestAllTypes.NestedEnum] {
  407. get {return _storage._repeatedNestedEnum}
  408. set {_uniqueStorage()._repeatedNestedEnum = newValue}
  409. }
  410. var repeatedForeignEnum: [Proto3ArenaUnittest_ForeignEnum] {
  411. get {return _storage._repeatedForeignEnum}
  412. set {_uniqueStorage()._repeatedForeignEnum = newValue}
  413. }
  414. var repeatedStringPiece: [String] {
  415. get {return _storage._repeatedStringPiece}
  416. set {_uniqueStorage()._repeatedStringPiece = newValue}
  417. }
  418. var repeatedCord: [String] {
  419. get {return _storage._repeatedCord}
  420. set {_uniqueStorage()._repeatedCord = newValue}
  421. }
  422. var repeatedLazyMessage: [Proto3ArenaUnittest_TestAllTypes.NestedMessage] {
  423. get {return _storage._repeatedLazyMessage}
  424. set {_uniqueStorage()._repeatedLazyMessage = newValue}
  425. }
  426. var oneofField: OneOf_OneofField? {
  427. get {return _storage._oneofField}
  428. set {_uniqueStorage()._oneofField = newValue}
  429. }
  430. var oneofUint32: UInt32 {
  431. get {
  432. if case .oneofUint32(let v)? = _storage._oneofField {return v}
  433. return 0
  434. }
  435. set {_uniqueStorage()._oneofField = .oneofUint32(newValue)}
  436. }
  437. var oneofNestedMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage {
  438. get {
  439. if case .oneofNestedMessage(let v)? = _storage._oneofField {return v}
  440. return Proto3ArenaUnittest_TestAllTypes.NestedMessage()
  441. }
  442. set {_uniqueStorage()._oneofField = .oneofNestedMessage(newValue)}
  443. }
  444. var oneofString: String {
  445. get {
  446. if case .oneofString(let v)? = _storage._oneofField {return v}
  447. return String()
  448. }
  449. set {_uniqueStorage()._oneofField = .oneofString(newValue)}
  450. }
  451. var oneofBytes: Data {
  452. get {
  453. if case .oneofBytes(let v)? = _storage._oneofField {return v}
  454. return Data()
  455. }
  456. set {_uniqueStorage()._oneofField = .oneofBytes(newValue)}
  457. }
  458. var unknownFields = SwiftProtobuf.UnknownStorage()
  459. enum OneOf_OneofField: Equatable, @unchecked Sendable {
  460. case oneofUint32(UInt32)
  461. case oneofNestedMessage(Proto3ArenaUnittest_TestAllTypes.NestedMessage)
  462. case oneofString(String)
  463. case oneofBytes(Data)
  464. }
  465. enum NestedEnum: SwiftProtobuf.Enum, Swift.CaseIterable {
  466. typealias RawValue = Int
  467. case zero // = 0
  468. case foo // = 1
  469. case bar // = 2
  470. case baz // = 3
  471. /// Intentionally negative.
  472. case neg // = -1
  473. case UNRECOGNIZED(Int)
  474. init() {
  475. self = .zero
  476. }
  477. init?(rawValue: Int) {
  478. switch rawValue {
  479. case -1: self = .neg
  480. case 0: self = .zero
  481. case 1: self = .foo
  482. case 2: self = .bar
  483. case 3: self = .baz
  484. default: self = .UNRECOGNIZED(rawValue)
  485. }
  486. }
  487. var rawValue: Int {
  488. switch self {
  489. case .neg: return -1
  490. case .zero: return 0
  491. case .foo: return 1
  492. case .bar: return 2
  493. case .baz: return 3
  494. case .UNRECOGNIZED(let i): return i
  495. }
  496. }
  497. // The compiler won't synthesize support with the UNRECOGNIZED case.
  498. static let allCases: [Proto3ArenaUnittest_TestAllTypes.NestedEnum] = [
  499. .zero,
  500. .foo,
  501. .bar,
  502. .baz,
  503. .neg,
  504. ]
  505. }
  506. struct NestedMessage: Sendable {
  507. // SwiftProtobuf.Message conformance is added in an extension below. See the
  508. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  509. // methods supported on all messages.
  510. /// The field name "b" fails to compile in proto1 because it conflicts with
  511. /// a local variable named "b" in one of the generated methods. Doh.
  512. /// This file needs to compile in proto1 to test backwards-compatibility.
  513. var bb: Int32 = 0
  514. var unknownFields = SwiftProtobuf.UnknownStorage()
  515. init() {}
  516. }
  517. init() {}
  518. fileprivate var _storage = _StorageClass.defaultInstance
  519. }
  520. struct Proto3ArenaUnittest_TestPackedTypes: Sendable {
  521. // SwiftProtobuf.Message conformance is added in an extension below. See the
  522. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  523. // methods supported on all messages.
  524. var packedInt32: [Int32] = []
  525. var packedInt64: [Int64] = []
  526. var packedUint32: [UInt32] = []
  527. var packedUint64: [UInt64] = []
  528. var packedSint32: [Int32] = []
  529. var packedSint64: [Int64] = []
  530. var packedFixed32: [UInt32] = []
  531. var packedFixed64: [UInt64] = []
  532. var packedSfixed32: [Int32] = []
  533. var packedSfixed64: [Int64] = []
  534. var packedFloat: [Float] = []
  535. var packedDouble: [Double] = []
  536. var packedBool: [Bool] = []
  537. var packedEnum: [Proto3ArenaUnittest_ForeignEnum] = []
  538. var unknownFields = SwiftProtobuf.UnknownStorage()
  539. init() {}
  540. }
  541. /// Explicitly set packed to false
  542. struct Proto3ArenaUnittest_TestUnpackedTypes: Sendable {
  543. // SwiftProtobuf.Message conformance is added in an extension below. See the
  544. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  545. // methods supported on all messages.
  546. var repeatedInt32: [Int32] = []
  547. var repeatedInt64: [Int64] = []
  548. var repeatedUint32: [UInt32] = []
  549. var repeatedUint64: [UInt64] = []
  550. var repeatedSint32: [Int32] = []
  551. var repeatedSint64: [Int64] = []
  552. var repeatedFixed32: [UInt32] = []
  553. var repeatedFixed64: [UInt64] = []
  554. var repeatedSfixed32: [Int32] = []
  555. var repeatedSfixed64: [Int64] = []
  556. var repeatedFloat: [Float] = []
  557. var repeatedDouble: [Double] = []
  558. var repeatedBool: [Bool] = []
  559. var repeatedNestedEnum: [Proto3ArenaUnittest_TestAllTypes.NestedEnum] = []
  560. var unknownFields = SwiftProtobuf.UnknownStorage()
  561. init() {}
  562. }
  563. /// This proto includes a recursively nested message.
  564. struct Proto3ArenaUnittest_NestedTestAllTypes: @unchecked Sendable {
  565. // SwiftProtobuf.Message conformance is added in an extension below. See the
  566. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  567. // methods supported on all messages.
  568. var child: Proto3ArenaUnittest_NestedTestAllTypes {
  569. get {return _storage._child ?? Proto3ArenaUnittest_NestedTestAllTypes()}
  570. set {_uniqueStorage()._child = newValue}
  571. }
  572. /// Returns true if `child` has been explicitly set.
  573. var hasChild: Bool {return _storage._child != nil}
  574. /// Clears the value of `child`. Subsequent reads from it will return its default value.
  575. mutating func clearChild() {_uniqueStorage()._child = nil}
  576. var payload: Proto3ArenaUnittest_TestAllTypes {
  577. get {return _storage._payload ?? Proto3ArenaUnittest_TestAllTypes()}
  578. set {_uniqueStorage()._payload = newValue}
  579. }
  580. /// Returns true if `payload` has been explicitly set.
  581. var hasPayload: Bool {return _storage._payload != nil}
  582. /// Clears the value of `payload`. Subsequent reads from it will return its default value.
  583. mutating func clearPayload() {_uniqueStorage()._payload = nil}
  584. var repeatedChild: [Proto3ArenaUnittest_NestedTestAllTypes] {
  585. get {return _storage._repeatedChild}
  586. set {_uniqueStorage()._repeatedChild = newValue}
  587. }
  588. var lazyPayload: Proto3ArenaUnittest_TestAllTypes {
  589. get {return _storage._lazyPayload ?? Proto3ArenaUnittest_TestAllTypes()}
  590. set {_uniqueStorage()._lazyPayload = newValue}
  591. }
  592. /// Returns true if `lazyPayload` has been explicitly set.
  593. var hasLazyPayload: Bool {return _storage._lazyPayload != nil}
  594. /// Clears the value of `lazyPayload`. Subsequent reads from it will return its default value.
  595. mutating func clearLazyPayload() {_uniqueStorage()._lazyPayload = nil}
  596. var unknownFields = SwiftProtobuf.UnknownStorage()
  597. init() {}
  598. fileprivate var _storage = _StorageClass.defaultInstance
  599. }
  600. /// Define these after TestAllTypes to make sure the compiler can handle
  601. /// that.
  602. struct Proto3ArenaUnittest_ForeignMessage: Sendable {
  603. // SwiftProtobuf.Message conformance is added in an extension below. See the
  604. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  605. // methods supported on all messages.
  606. var c: Int32 = 0
  607. var unknownFields = SwiftProtobuf.UnknownStorage()
  608. init() {}
  609. }
  610. /// TestEmptyMessage is used to test behavior of unknown fields.
  611. struct Proto3ArenaUnittest_TestEmptyMessage: Sendable {
  612. // SwiftProtobuf.Message conformance is added in an extension below. See the
  613. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  614. // methods supported on all messages.
  615. var unknownFields = SwiftProtobuf.UnknownStorage()
  616. init() {}
  617. }
  618. /// Needed for a Python test.
  619. struct Proto3ArenaUnittest_TestPickleNestedMessage: Sendable {
  620. // SwiftProtobuf.Message conformance is added in an extension below. See the
  621. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  622. // methods supported on all messages.
  623. var unknownFields = SwiftProtobuf.UnknownStorage()
  624. struct NestedMessage: Sendable {
  625. // SwiftProtobuf.Message conformance is added in an extension below. See the
  626. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  627. // methods supported on all messages.
  628. var bb: Int32 = 0
  629. var unknownFields = SwiftProtobuf.UnknownStorage()
  630. struct NestedNestedMessage: Sendable {
  631. // SwiftProtobuf.Message conformance is added in an extension below. See the
  632. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  633. // methods supported on all messages.
  634. var cc: Int32 = 0
  635. var unknownFields = SwiftProtobuf.UnknownStorage()
  636. init() {}
  637. }
  638. init() {}
  639. }
  640. init() {}
  641. }
  642. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  643. fileprivate let _protobuf_package = "proto3_arena_unittest"
  644. extension Proto3ArenaUnittest_ForeignEnum: SwiftProtobuf._ProtoNameProviding {
  645. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  646. 0: .same(proto: "FOREIGN_ZERO"),
  647. 4: .same(proto: "FOREIGN_FOO"),
  648. 5: .same(proto: "FOREIGN_BAR"),
  649. 6: .same(proto: "FOREIGN_BAZ"),
  650. 123456: .same(proto: "FOREIGN_LARGE"),
  651. ]
  652. }
  653. extension Proto3ArenaUnittest_TestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  654. static let protoMessageName: String = _protobuf_package + ".TestAllTypes"
  655. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  656. 1: .standard(proto: "optional_int32"),
  657. 2: .standard(proto: "optional_int64"),
  658. 3: .standard(proto: "optional_uint32"),
  659. 4: .standard(proto: "optional_uint64"),
  660. 5: .standard(proto: "optional_sint32"),
  661. 6: .standard(proto: "optional_sint64"),
  662. 7: .standard(proto: "optional_fixed32"),
  663. 8: .standard(proto: "optional_fixed64"),
  664. 9: .standard(proto: "optional_sfixed32"),
  665. 10: .standard(proto: "optional_sfixed64"),
  666. 11: .standard(proto: "optional_float"),
  667. 12: .standard(proto: "optional_double"),
  668. 13: .standard(proto: "optional_bool"),
  669. 14: .standard(proto: "optional_string"),
  670. 15: .standard(proto: "optional_bytes"),
  671. 18: .standard(proto: "optional_nested_message"),
  672. 19: .standard(proto: "optional_foreign_message"),
  673. 20: .standard(proto: "optional_import_message"),
  674. 21: .standard(proto: "optional_nested_enum"),
  675. 22: .standard(proto: "optional_foreign_enum"),
  676. 24: .standard(proto: "optional_string_piece"),
  677. 25: .standard(proto: "optional_cord"),
  678. 86: .standard(proto: "optional_bytes_cord"),
  679. 26: .standard(proto: "optional_public_import_message"),
  680. 27: .standard(proto: "optional_lazy_message"),
  681. 28: .standard(proto: "optional_unverified_lazy_message"),
  682. 115: .standard(proto: "optional_lazy_import_message"),
  683. 31: .standard(proto: "repeated_int32"),
  684. 32: .standard(proto: "repeated_int64"),
  685. 33: .standard(proto: "repeated_uint32"),
  686. 34: .standard(proto: "repeated_uint64"),
  687. 35: .standard(proto: "repeated_sint32"),
  688. 36: .standard(proto: "repeated_sint64"),
  689. 37: .standard(proto: "repeated_fixed32"),
  690. 38: .standard(proto: "repeated_fixed64"),
  691. 39: .standard(proto: "repeated_sfixed32"),
  692. 40: .standard(proto: "repeated_sfixed64"),
  693. 41: .standard(proto: "repeated_float"),
  694. 42: .standard(proto: "repeated_double"),
  695. 43: .standard(proto: "repeated_bool"),
  696. 44: .standard(proto: "repeated_string"),
  697. 45: .standard(proto: "repeated_bytes"),
  698. 116: .standard(proto: "proto3_optional_int32"),
  699. 117: .standard(proto: "proto3_optional_int64"),
  700. 118: .standard(proto: "proto3_optional_uint32"),
  701. 119: .standard(proto: "proto3_optional_uint64"),
  702. 120: .standard(proto: "proto3_optional_sint32"),
  703. 121: .standard(proto: "proto3_optional_sint64"),
  704. 122: .standard(proto: "proto3_optional_fixed32"),
  705. 123: .standard(proto: "proto3_optional_fixed64"),
  706. 124: .standard(proto: "proto3_optional_sfixed32"),
  707. 125: .standard(proto: "proto3_optional_sfixed64"),
  708. 126: .standard(proto: "proto3_optional_float"),
  709. 127: .standard(proto: "proto3_optional_double"),
  710. 128: .standard(proto: "proto3_optional_bool"),
  711. 129: .standard(proto: "proto3_optional_string"),
  712. 130: .standard(proto: "proto3_optional_bytes"),
  713. 48: .standard(proto: "repeated_nested_message"),
  714. 49: .standard(proto: "repeated_foreign_message"),
  715. 50: .standard(proto: "repeated_import_message"),
  716. 51: .standard(proto: "repeated_nested_enum"),
  717. 52: .standard(proto: "repeated_foreign_enum"),
  718. 54: .standard(proto: "repeated_string_piece"),
  719. 55: .standard(proto: "repeated_cord"),
  720. 57: .standard(proto: "repeated_lazy_message"),
  721. 111: .standard(proto: "oneof_uint32"),
  722. 112: .standard(proto: "oneof_nested_message"),
  723. 113: .standard(proto: "oneof_string"),
  724. 114: .standard(proto: "oneof_bytes"),
  725. ]
  726. fileprivate class _StorageClass {
  727. var _optionalInt32: Int32 = 0
  728. var _optionalInt64: Int64 = 0
  729. var _optionalUint32: UInt32 = 0
  730. var _optionalUint64: UInt64 = 0
  731. var _optionalSint32: Int32 = 0
  732. var _optionalSint64: Int64 = 0
  733. var _optionalFixed32: UInt32 = 0
  734. var _optionalFixed64: UInt64 = 0
  735. var _optionalSfixed32: Int32 = 0
  736. var _optionalSfixed64: Int64 = 0
  737. var _optionalFloat: Float = 0
  738. var _optionalDouble: Double = 0
  739. var _optionalBool: Bool = false
  740. var _optionalString: String = String()
  741. var _optionalBytes: Data = Data()
  742. var _optionalNestedMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage? = nil
  743. var _optionalForeignMessage: Proto3ArenaUnittest_ForeignMessage? = nil
  744. var _optionalImportMessage: Proto2UnittestImport_ImportMessage? = nil
  745. var _optionalNestedEnum: Proto3ArenaUnittest_TestAllTypes.NestedEnum = .zero
  746. var _optionalForeignEnum: Proto3ArenaUnittest_ForeignEnum = .foreignZero
  747. var _optionalStringPiece: String = String()
  748. var _optionalCord: String = String()
  749. var _optionalBytesCord: Data = Data()
  750. var _optionalPublicImportMessage: Proto2UnittestImport_PublicImportMessage? = nil
  751. var _optionalLazyMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage? = nil
  752. var _optionalUnverifiedLazyMessage: Proto3ArenaUnittest_TestAllTypes.NestedMessage? = nil
  753. var _optionalLazyImportMessage: Proto2UnittestImport_ImportMessage? = nil
  754. var _repeatedInt32: [Int32] = []
  755. var _repeatedInt64: [Int64] = []
  756. var _repeatedUint32: [UInt32] = []
  757. var _repeatedUint64: [UInt64] = []
  758. var _repeatedSint32: [Int32] = []
  759. var _repeatedSint64: [Int64] = []
  760. var _repeatedFixed32: [UInt32] = []
  761. var _repeatedFixed64: [UInt64] = []
  762. var _repeatedSfixed32: [Int32] = []
  763. var _repeatedSfixed64: [Int64] = []
  764. var _repeatedFloat: [Float] = []
  765. var _repeatedDouble: [Double] = []
  766. var _repeatedBool: [Bool] = []
  767. var _repeatedString: [String] = []
  768. var _repeatedBytes: [Data] = []
  769. var _proto3OptionalInt32: Int32? = nil
  770. var _proto3OptionalInt64: Int64? = nil
  771. var _proto3OptionalUint32: UInt32? = nil
  772. var _proto3OptionalUint64: UInt64? = nil
  773. var _proto3OptionalSint32: Int32? = nil
  774. var _proto3OptionalSint64: Int64? = nil
  775. var _proto3OptionalFixed32: UInt32? = nil
  776. var _proto3OptionalFixed64: UInt64? = nil
  777. var _proto3OptionalSfixed32: Int32? = nil
  778. var _proto3OptionalSfixed64: Int64? = nil
  779. var _proto3OptionalFloat: Float? = nil
  780. var _proto3OptionalDouble: Double? = nil
  781. var _proto3OptionalBool: Bool? = nil
  782. var _proto3OptionalString: String? = nil
  783. var _proto3OptionalBytes: Data? = nil
  784. var _repeatedNestedMessage: [Proto3ArenaUnittest_TestAllTypes.NestedMessage] = []
  785. var _repeatedForeignMessage: [Proto3ArenaUnittest_ForeignMessage] = []
  786. var _repeatedImportMessage: [Proto2UnittestImport_ImportMessage] = []
  787. var _repeatedNestedEnum: [Proto3ArenaUnittest_TestAllTypes.NestedEnum] = []
  788. var _repeatedForeignEnum: [Proto3ArenaUnittest_ForeignEnum] = []
  789. var _repeatedStringPiece: [String] = []
  790. var _repeatedCord: [String] = []
  791. var _repeatedLazyMessage: [Proto3ArenaUnittest_TestAllTypes.NestedMessage] = []
  792. var _oneofField: Proto3ArenaUnittest_TestAllTypes.OneOf_OneofField?
  793. // This property is used as the initial default value for new instances of the type.
  794. // The type itself is protecting the reference to its storage via CoW semantics.
  795. // This will force a copy to be made of this reference when the first mutation occurs;
  796. // hence, it is safe to mark this as `nonisolated(unsafe)`.
  797. static nonisolated(unsafe) let defaultInstance = _StorageClass()
  798. private init() {}
  799. init(copying source: _StorageClass) {
  800. _optionalInt32 = source._optionalInt32
  801. _optionalInt64 = source._optionalInt64
  802. _optionalUint32 = source._optionalUint32
  803. _optionalUint64 = source._optionalUint64
  804. _optionalSint32 = source._optionalSint32
  805. _optionalSint64 = source._optionalSint64
  806. _optionalFixed32 = source._optionalFixed32
  807. _optionalFixed64 = source._optionalFixed64
  808. _optionalSfixed32 = source._optionalSfixed32
  809. _optionalSfixed64 = source._optionalSfixed64
  810. _optionalFloat = source._optionalFloat
  811. _optionalDouble = source._optionalDouble
  812. _optionalBool = source._optionalBool
  813. _optionalString = source._optionalString
  814. _optionalBytes = source._optionalBytes
  815. _optionalNestedMessage = source._optionalNestedMessage
  816. _optionalForeignMessage = source._optionalForeignMessage
  817. _optionalImportMessage = source._optionalImportMessage
  818. _optionalNestedEnum = source._optionalNestedEnum
  819. _optionalForeignEnum = source._optionalForeignEnum
  820. _optionalStringPiece = source._optionalStringPiece
  821. _optionalCord = source._optionalCord
  822. _optionalBytesCord = source._optionalBytesCord
  823. _optionalPublicImportMessage = source._optionalPublicImportMessage
  824. _optionalLazyMessage = source._optionalLazyMessage
  825. _optionalUnverifiedLazyMessage = source._optionalUnverifiedLazyMessage
  826. _optionalLazyImportMessage = source._optionalLazyImportMessage
  827. _repeatedInt32 = source._repeatedInt32
  828. _repeatedInt64 = source._repeatedInt64
  829. _repeatedUint32 = source._repeatedUint32
  830. _repeatedUint64 = source._repeatedUint64
  831. _repeatedSint32 = source._repeatedSint32
  832. _repeatedSint64 = source._repeatedSint64
  833. _repeatedFixed32 = source._repeatedFixed32
  834. _repeatedFixed64 = source._repeatedFixed64
  835. _repeatedSfixed32 = source._repeatedSfixed32
  836. _repeatedSfixed64 = source._repeatedSfixed64
  837. _repeatedFloat = source._repeatedFloat
  838. _repeatedDouble = source._repeatedDouble
  839. _repeatedBool = source._repeatedBool
  840. _repeatedString = source._repeatedString
  841. _repeatedBytes = source._repeatedBytes
  842. _proto3OptionalInt32 = source._proto3OptionalInt32
  843. _proto3OptionalInt64 = source._proto3OptionalInt64
  844. _proto3OptionalUint32 = source._proto3OptionalUint32
  845. _proto3OptionalUint64 = source._proto3OptionalUint64
  846. _proto3OptionalSint32 = source._proto3OptionalSint32
  847. _proto3OptionalSint64 = source._proto3OptionalSint64
  848. _proto3OptionalFixed32 = source._proto3OptionalFixed32
  849. _proto3OptionalFixed64 = source._proto3OptionalFixed64
  850. _proto3OptionalSfixed32 = source._proto3OptionalSfixed32
  851. _proto3OptionalSfixed64 = source._proto3OptionalSfixed64
  852. _proto3OptionalFloat = source._proto3OptionalFloat
  853. _proto3OptionalDouble = source._proto3OptionalDouble
  854. _proto3OptionalBool = source._proto3OptionalBool
  855. _proto3OptionalString = source._proto3OptionalString
  856. _proto3OptionalBytes = source._proto3OptionalBytes
  857. _repeatedNestedMessage = source._repeatedNestedMessage
  858. _repeatedForeignMessage = source._repeatedForeignMessage
  859. _repeatedImportMessage = source._repeatedImportMessage
  860. _repeatedNestedEnum = source._repeatedNestedEnum
  861. _repeatedForeignEnum = source._repeatedForeignEnum
  862. _repeatedStringPiece = source._repeatedStringPiece
  863. _repeatedCord = source._repeatedCord
  864. _repeatedLazyMessage = source._repeatedLazyMessage
  865. _oneofField = source._oneofField
  866. }
  867. }
  868. fileprivate mutating func _uniqueStorage() -> _StorageClass {
  869. if !isKnownUniquelyReferenced(&_storage) {
  870. _storage = _StorageClass(copying: _storage)
  871. }
  872. return _storage
  873. }
  874. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  875. _ = _uniqueStorage()
  876. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  877. while let fieldNumber = try decoder.nextFieldNumber() {
  878. // The use of inline closures is to circumvent an issue where the compiler
  879. // allocates stack space for every case branch when no optimizations are
  880. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  881. switch fieldNumber {
  882. case 1: try { try decoder.decodeSingularInt32Field(value: &_storage._optionalInt32) }()
  883. case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._optionalInt64) }()
  884. case 3: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint32) }()
  885. case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._optionalUint64) }()
  886. case 5: try { try decoder.decodeSingularSInt32Field(value: &_storage._optionalSint32) }()
  887. case 6: try { try decoder.decodeSingularSInt64Field(value: &_storage._optionalSint64) }()
  888. case 7: try { try decoder.decodeSingularFixed32Field(value: &_storage._optionalFixed32) }()
  889. case 8: try { try decoder.decodeSingularFixed64Field(value: &_storage._optionalFixed64) }()
  890. case 9: try { try decoder.decodeSingularSFixed32Field(value: &_storage._optionalSfixed32) }()
  891. case 10: try { try decoder.decodeSingularSFixed64Field(value: &_storage._optionalSfixed64) }()
  892. case 11: try { try decoder.decodeSingularFloatField(value: &_storage._optionalFloat) }()
  893. case 12: try { try decoder.decodeSingularDoubleField(value: &_storage._optionalDouble) }()
  894. case 13: try { try decoder.decodeSingularBoolField(value: &_storage._optionalBool) }()
  895. case 14: try { try decoder.decodeSingularStringField(value: &_storage._optionalString) }()
  896. case 15: try { try decoder.decodeSingularBytesField(value: &_storage._optionalBytes) }()
  897. case 18: try { try decoder.decodeSingularMessageField(value: &_storage._optionalNestedMessage) }()
  898. case 19: try { try decoder.decodeSingularMessageField(value: &_storage._optionalForeignMessage) }()
  899. case 20: try { try decoder.decodeSingularMessageField(value: &_storage._optionalImportMessage) }()
  900. case 21: try { try decoder.decodeSingularEnumField(value: &_storage._optionalNestedEnum) }()
  901. case 22: try { try decoder.decodeSingularEnumField(value: &_storage._optionalForeignEnum) }()
  902. case 24: try { try decoder.decodeSingularStringField(value: &_storage._optionalStringPiece) }()
  903. case 25: try { try decoder.decodeSingularStringField(value: &_storage._optionalCord) }()
  904. case 26: try { try decoder.decodeSingularMessageField(value: &_storage._optionalPublicImportMessage) }()
  905. case 27: try { try decoder.decodeSingularMessageField(value: &_storage._optionalLazyMessage) }()
  906. case 28: try { try decoder.decodeSingularMessageField(value: &_storage._optionalUnverifiedLazyMessage) }()
  907. case 31: try { try decoder.decodeRepeatedInt32Field(value: &_storage._repeatedInt32) }()
  908. case 32: try { try decoder.decodeRepeatedInt64Field(value: &_storage._repeatedInt64) }()
  909. case 33: try { try decoder.decodeRepeatedUInt32Field(value: &_storage._repeatedUint32) }()
  910. case 34: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._repeatedUint64) }()
  911. case 35: try { try decoder.decodeRepeatedSInt32Field(value: &_storage._repeatedSint32) }()
  912. case 36: try { try decoder.decodeRepeatedSInt64Field(value: &_storage._repeatedSint64) }()
  913. case 37: try { try decoder.decodeRepeatedFixed32Field(value: &_storage._repeatedFixed32) }()
  914. case 38: try { try decoder.decodeRepeatedFixed64Field(value: &_storage._repeatedFixed64) }()
  915. case 39: try { try decoder.decodeRepeatedSFixed32Field(value: &_storage._repeatedSfixed32) }()
  916. case 40: try { try decoder.decodeRepeatedSFixed64Field(value: &_storage._repeatedSfixed64) }()
  917. case 41: try { try decoder.decodeRepeatedFloatField(value: &_storage._repeatedFloat) }()
  918. case 42: try { try decoder.decodeRepeatedDoubleField(value: &_storage._repeatedDouble) }()
  919. case 43: try { try decoder.decodeRepeatedBoolField(value: &_storage._repeatedBool) }()
  920. case 44: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedString) }()
  921. case 45: try { try decoder.decodeRepeatedBytesField(value: &_storage._repeatedBytes) }()
  922. case 48: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedNestedMessage) }()
  923. case 49: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedForeignMessage) }()
  924. case 50: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedImportMessage) }()
  925. case 51: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedNestedEnum) }()
  926. case 52: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedForeignEnum) }()
  927. case 54: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedStringPiece) }()
  928. case 55: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedCord) }()
  929. case 57: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedLazyMessage) }()
  930. case 86: try { try decoder.decodeSingularBytesField(value: &_storage._optionalBytesCord) }()
  931. case 111: try {
  932. var v: UInt32?
  933. try decoder.decodeSingularUInt32Field(value: &v)
  934. if let v = v {
  935. if _storage._oneofField != nil {try decoder.handleConflictingOneOf()}
  936. _storage._oneofField = .oneofUint32(v)
  937. }
  938. }()
  939. case 112: try {
  940. var v: Proto3ArenaUnittest_TestAllTypes.NestedMessage?
  941. var hadOneofValue = false
  942. if let current = _storage._oneofField {
  943. hadOneofValue = true
  944. if case .oneofNestedMessage(let m) = current {v = m}
  945. }
  946. try decoder.decodeSingularMessageField(value: &v)
  947. if let v = v {
  948. if hadOneofValue {try decoder.handleConflictingOneOf()}
  949. _storage._oneofField = .oneofNestedMessage(v)
  950. }
  951. }()
  952. case 113: try {
  953. var v: String?
  954. try decoder.decodeSingularStringField(value: &v)
  955. if let v = v {
  956. if _storage._oneofField != nil {try decoder.handleConflictingOneOf()}
  957. _storage._oneofField = .oneofString(v)
  958. }
  959. }()
  960. case 114: try {
  961. var v: Data?
  962. try decoder.decodeSingularBytesField(value: &v)
  963. if let v = v {
  964. if _storage._oneofField != nil {try decoder.handleConflictingOneOf()}
  965. _storage._oneofField = .oneofBytes(v)
  966. }
  967. }()
  968. case 115: try { try decoder.decodeSingularMessageField(value: &_storage._optionalLazyImportMessage) }()
  969. case 116: try { try decoder.decodeSingularInt32Field(value: &_storage._proto3OptionalInt32) }()
  970. case 117: try { try decoder.decodeSingularInt64Field(value: &_storage._proto3OptionalInt64) }()
  971. case 118: try { try decoder.decodeSingularUInt32Field(value: &_storage._proto3OptionalUint32) }()
  972. case 119: try { try decoder.decodeSingularUInt64Field(value: &_storage._proto3OptionalUint64) }()
  973. case 120: try { try decoder.decodeSingularSInt32Field(value: &_storage._proto3OptionalSint32) }()
  974. case 121: try { try decoder.decodeSingularSInt64Field(value: &_storage._proto3OptionalSint64) }()
  975. case 122: try { try decoder.decodeSingularFixed32Field(value: &_storage._proto3OptionalFixed32) }()
  976. case 123: try { try decoder.decodeSingularFixed64Field(value: &_storage._proto3OptionalFixed64) }()
  977. case 124: try { try decoder.decodeSingularSFixed32Field(value: &_storage._proto3OptionalSfixed32) }()
  978. case 125: try { try decoder.decodeSingularSFixed64Field(value: &_storage._proto3OptionalSfixed64) }()
  979. case 126: try { try decoder.decodeSingularFloatField(value: &_storage._proto3OptionalFloat) }()
  980. case 127: try { try decoder.decodeSingularDoubleField(value: &_storage._proto3OptionalDouble) }()
  981. case 128: try { try decoder.decodeSingularBoolField(value: &_storage._proto3OptionalBool) }()
  982. case 129: try { try decoder.decodeSingularStringField(value: &_storage._proto3OptionalString) }()
  983. case 130: try { try decoder.decodeSingularBytesField(value: &_storage._proto3OptionalBytes) }()
  984. default: break
  985. }
  986. }
  987. }
  988. }
  989. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  990. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  991. // The use of inline closures is to circumvent an issue where the compiler
  992. // allocates stack space for every if/case branch local when no optimizations
  993. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  994. // https://github.com/apple/swift-protobuf/issues/1182
  995. if _storage._optionalInt32 != 0 {
  996. try visitor.visitSingularInt32Field(value: _storage._optionalInt32, fieldNumber: 1)
  997. }
  998. if _storage._optionalInt64 != 0 {
  999. try visitor.visitSingularInt64Field(value: _storage._optionalInt64, fieldNumber: 2)
  1000. }
  1001. if _storage._optionalUint32 != 0 {
  1002. try visitor.visitSingularUInt32Field(value: _storage._optionalUint32, fieldNumber: 3)
  1003. }
  1004. if _storage._optionalUint64 != 0 {
  1005. try visitor.visitSingularUInt64Field(value: _storage._optionalUint64, fieldNumber: 4)
  1006. }
  1007. if _storage._optionalSint32 != 0 {
  1008. try visitor.visitSingularSInt32Field(value: _storage._optionalSint32, fieldNumber: 5)
  1009. }
  1010. if _storage._optionalSint64 != 0 {
  1011. try visitor.visitSingularSInt64Field(value: _storage._optionalSint64, fieldNumber: 6)
  1012. }
  1013. if _storage._optionalFixed32 != 0 {
  1014. try visitor.visitSingularFixed32Field(value: _storage._optionalFixed32, fieldNumber: 7)
  1015. }
  1016. if _storage._optionalFixed64 != 0 {
  1017. try visitor.visitSingularFixed64Field(value: _storage._optionalFixed64, fieldNumber: 8)
  1018. }
  1019. if _storage._optionalSfixed32 != 0 {
  1020. try visitor.visitSingularSFixed32Field(value: _storage._optionalSfixed32, fieldNumber: 9)
  1021. }
  1022. if _storage._optionalSfixed64 != 0 {
  1023. try visitor.visitSingularSFixed64Field(value: _storage._optionalSfixed64, fieldNumber: 10)
  1024. }
  1025. if _storage._optionalFloat.bitPattern != 0 {
  1026. try visitor.visitSingularFloatField(value: _storage._optionalFloat, fieldNumber: 11)
  1027. }
  1028. if _storage._optionalDouble.bitPattern != 0 {
  1029. try visitor.visitSingularDoubleField(value: _storage._optionalDouble, fieldNumber: 12)
  1030. }
  1031. if _storage._optionalBool != false {
  1032. try visitor.visitSingularBoolField(value: _storage._optionalBool, fieldNumber: 13)
  1033. }
  1034. if !_storage._optionalString.isEmpty {
  1035. try visitor.visitSingularStringField(value: _storage._optionalString, fieldNumber: 14)
  1036. }
  1037. if !_storage._optionalBytes.isEmpty {
  1038. try visitor.visitSingularBytesField(value: _storage._optionalBytes, fieldNumber: 15)
  1039. }
  1040. try { if let v = _storage._optionalNestedMessage {
  1041. try visitor.visitSingularMessageField(value: v, fieldNumber: 18)
  1042. } }()
  1043. try { if let v = _storage._optionalForeignMessage {
  1044. try visitor.visitSingularMessageField(value: v, fieldNumber: 19)
  1045. } }()
  1046. try { if let v = _storage._optionalImportMessage {
  1047. try visitor.visitSingularMessageField(value: v, fieldNumber: 20)
  1048. } }()
  1049. if _storage._optionalNestedEnum != .zero {
  1050. try visitor.visitSingularEnumField(value: _storage._optionalNestedEnum, fieldNumber: 21)
  1051. }
  1052. if _storage._optionalForeignEnum != .foreignZero {
  1053. try visitor.visitSingularEnumField(value: _storage._optionalForeignEnum, fieldNumber: 22)
  1054. }
  1055. if !_storage._optionalStringPiece.isEmpty {
  1056. try visitor.visitSingularStringField(value: _storage._optionalStringPiece, fieldNumber: 24)
  1057. }
  1058. if !_storage._optionalCord.isEmpty {
  1059. try visitor.visitSingularStringField(value: _storage._optionalCord, fieldNumber: 25)
  1060. }
  1061. try { if let v = _storage._optionalPublicImportMessage {
  1062. try visitor.visitSingularMessageField(value: v, fieldNumber: 26)
  1063. } }()
  1064. try { if let v = _storage._optionalLazyMessage {
  1065. try visitor.visitSingularMessageField(value: v, fieldNumber: 27)
  1066. } }()
  1067. try { if let v = _storage._optionalUnverifiedLazyMessage {
  1068. try visitor.visitSingularMessageField(value: v, fieldNumber: 28)
  1069. } }()
  1070. if !_storage._repeatedInt32.isEmpty {
  1071. try visitor.visitPackedInt32Field(value: _storage._repeatedInt32, fieldNumber: 31)
  1072. }
  1073. if !_storage._repeatedInt64.isEmpty {
  1074. try visitor.visitPackedInt64Field(value: _storage._repeatedInt64, fieldNumber: 32)
  1075. }
  1076. if !_storage._repeatedUint32.isEmpty {
  1077. try visitor.visitPackedUInt32Field(value: _storage._repeatedUint32, fieldNumber: 33)
  1078. }
  1079. if !_storage._repeatedUint64.isEmpty {
  1080. try visitor.visitPackedUInt64Field(value: _storage._repeatedUint64, fieldNumber: 34)
  1081. }
  1082. if !_storage._repeatedSint32.isEmpty {
  1083. try visitor.visitPackedSInt32Field(value: _storage._repeatedSint32, fieldNumber: 35)
  1084. }
  1085. if !_storage._repeatedSint64.isEmpty {
  1086. try visitor.visitPackedSInt64Field(value: _storage._repeatedSint64, fieldNumber: 36)
  1087. }
  1088. if !_storage._repeatedFixed32.isEmpty {
  1089. try visitor.visitPackedFixed32Field(value: _storage._repeatedFixed32, fieldNumber: 37)
  1090. }
  1091. if !_storage._repeatedFixed64.isEmpty {
  1092. try visitor.visitPackedFixed64Field(value: _storage._repeatedFixed64, fieldNumber: 38)
  1093. }
  1094. if !_storage._repeatedSfixed32.isEmpty {
  1095. try visitor.visitPackedSFixed32Field(value: _storage._repeatedSfixed32, fieldNumber: 39)
  1096. }
  1097. if !_storage._repeatedSfixed64.isEmpty {
  1098. try visitor.visitPackedSFixed64Field(value: _storage._repeatedSfixed64, fieldNumber: 40)
  1099. }
  1100. if !_storage._repeatedFloat.isEmpty {
  1101. try visitor.visitPackedFloatField(value: _storage._repeatedFloat, fieldNumber: 41)
  1102. }
  1103. if !_storage._repeatedDouble.isEmpty {
  1104. try visitor.visitPackedDoubleField(value: _storage._repeatedDouble, fieldNumber: 42)
  1105. }
  1106. if !_storage._repeatedBool.isEmpty {
  1107. try visitor.visitPackedBoolField(value: _storage._repeatedBool, fieldNumber: 43)
  1108. }
  1109. if !_storage._repeatedString.isEmpty {
  1110. try visitor.visitRepeatedStringField(value: _storage._repeatedString, fieldNumber: 44)
  1111. }
  1112. if !_storage._repeatedBytes.isEmpty {
  1113. try visitor.visitRepeatedBytesField(value: _storage._repeatedBytes, fieldNumber: 45)
  1114. }
  1115. if !_storage._repeatedNestedMessage.isEmpty {
  1116. try visitor.visitRepeatedMessageField(value: _storage._repeatedNestedMessage, fieldNumber: 48)
  1117. }
  1118. if !_storage._repeatedForeignMessage.isEmpty {
  1119. try visitor.visitRepeatedMessageField(value: _storage._repeatedForeignMessage, fieldNumber: 49)
  1120. }
  1121. if !_storage._repeatedImportMessage.isEmpty {
  1122. try visitor.visitRepeatedMessageField(value: _storage._repeatedImportMessage, fieldNumber: 50)
  1123. }
  1124. if !_storage._repeatedNestedEnum.isEmpty {
  1125. try visitor.visitPackedEnumField(value: _storage._repeatedNestedEnum, fieldNumber: 51)
  1126. }
  1127. if !_storage._repeatedForeignEnum.isEmpty {
  1128. try visitor.visitPackedEnumField(value: _storage._repeatedForeignEnum, fieldNumber: 52)
  1129. }
  1130. if !_storage._repeatedStringPiece.isEmpty {
  1131. try visitor.visitRepeatedStringField(value: _storage._repeatedStringPiece, fieldNumber: 54)
  1132. }
  1133. if !_storage._repeatedCord.isEmpty {
  1134. try visitor.visitRepeatedStringField(value: _storage._repeatedCord, fieldNumber: 55)
  1135. }
  1136. if !_storage._repeatedLazyMessage.isEmpty {
  1137. try visitor.visitRepeatedMessageField(value: _storage._repeatedLazyMessage, fieldNumber: 57)
  1138. }
  1139. if !_storage._optionalBytesCord.isEmpty {
  1140. try visitor.visitSingularBytesField(value: _storage._optionalBytesCord, fieldNumber: 86)
  1141. }
  1142. switch _storage._oneofField {
  1143. case .oneofUint32?: try {
  1144. guard case .oneofUint32(let v)? = _storage._oneofField else { preconditionFailure() }
  1145. try visitor.visitSingularUInt32Field(value: v, fieldNumber: 111)
  1146. }()
  1147. case .oneofNestedMessage?: try {
  1148. guard case .oneofNestedMessage(let v)? = _storage._oneofField else { preconditionFailure() }
  1149. try visitor.visitSingularMessageField(value: v, fieldNumber: 112)
  1150. }()
  1151. case .oneofString?: try {
  1152. guard case .oneofString(let v)? = _storage._oneofField else { preconditionFailure() }
  1153. try visitor.visitSingularStringField(value: v, fieldNumber: 113)
  1154. }()
  1155. case .oneofBytes?: try {
  1156. guard case .oneofBytes(let v)? = _storage._oneofField else { preconditionFailure() }
  1157. try visitor.visitSingularBytesField(value: v, fieldNumber: 114)
  1158. }()
  1159. case nil: break
  1160. }
  1161. try { if let v = _storage._optionalLazyImportMessage {
  1162. try visitor.visitSingularMessageField(value: v, fieldNumber: 115)
  1163. } }()
  1164. try { if let v = _storage._proto3OptionalInt32 {
  1165. try visitor.visitSingularInt32Field(value: v, fieldNumber: 116)
  1166. } }()
  1167. try { if let v = _storage._proto3OptionalInt64 {
  1168. try visitor.visitSingularInt64Field(value: v, fieldNumber: 117)
  1169. } }()
  1170. try { if let v = _storage._proto3OptionalUint32 {
  1171. try visitor.visitSingularUInt32Field(value: v, fieldNumber: 118)
  1172. } }()
  1173. try { if let v = _storage._proto3OptionalUint64 {
  1174. try visitor.visitSingularUInt64Field(value: v, fieldNumber: 119)
  1175. } }()
  1176. try { if let v = _storage._proto3OptionalSint32 {
  1177. try visitor.visitSingularSInt32Field(value: v, fieldNumber: 120)
  1178. } }()
  1179. try { if let v = _storage._proto3OptionalSint64 {
  1180. try visitor.visitSingularSInt64Field(value: v, fieldNumber: 121)
  1181. } }()
  1182. try { if let v = _storage._proto3OptionalFixed32 {
  1183. try visitor.visitSingularFixed32Field(value: v, fieldNumber: 122)
  1184. } }()
  1185. try { if let v = _storage._proto3OptionalFixed64 {
  1186. try visitor.visitSingularFixed64Field(value: v, fieldNumber: 123)
  1187. } }()
  1188. try { if let v = _storage._proto3OptionalSfixed32 {
  1189. try visitor.visitSingularSFixed32Field(value: v, fieldNumber: 124)
  1190. } }()
  1191. try { if let v = _storage._proto3OptionalSfixed64 {
  1192. try visitor.visitSingularSFixed64Field(value: v, fieldNumber: 125)
  1193. } }()
  1194. try { if let v = _storage._proto3OptionalFloat {
  1195. try visitor.visitSingularFloatField(value: v, fieldNumber: 126)
  1196. } }()
  1197. try { if let v = _storage._proto3OptionalDouble {
  1198. try visitor.visitSingularDoubleField(value: v, fieldNumber: 127)
  1199. } }()
  1200. try { if let v = _storage._proto3OptionalBool {
  1201. try visitor.visitSingularBoolField(value: v, fieldNumber: 128)
  1202. } }()
  1203. try { if let v = _storage._proto3OptionalString {
  1204. try visitor.visitSingularStringField(value: v, fieldNumber: 129)
  1205. } }()
  1206. try { if let v = _storage._proto3OptionalBytes {
  1207. try visitor.visitSingularBytesField(value: v, fieldNumber: 130)
  1208. } }()
  1209. }
  1210. try unknownFields.traverse(visitor: &visitor)
  1211. }
  1212. static func ==(lhs: Proto3ArenaUnittest_TestAllTypes, rhs: Proto3ArenaUnittest_TestAllTypes) -> Bool {
  1213. if lhs._storage !== rhs._storage {
  1214. let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
  1215. let _storage = _args.0
  1216. let rhs_storage = _args.1
  1217. if _storage._optionalInt32 != rhs_storage._optionalInt32 {return false}
  1218. if _storage._optionalInt64 != rhs_storage._optionalInt64 {return false}
  1219. if _storage._optionalUint32 != rhs_storage._optionalUint32 {return false}
  1220. if _storage._optionalUint64 != rhs_storage._optionalUint64 {return false}
  1221. if _storage._optionalSint32 != rhs_storage._optionalSint32 {return false}
  1222. if _storage._optionalSint64 != rhs_storage._optionalSint64 {return false}
  1223. if _storage._optionalFixed32 != rhs_storage._optionalFixed32 {return false}
  1224. if _storage._optionalFixed64 != rhs_storage._optionalFixed64 {return false}
  1225. if _storage._optionalSfixed32 != rhs_storage._optionalSfixed32 {return false}
  1226. if _storage._optionalSfixed64 != rhs_storage._optionalSfixed64 {return false}
  1227. if _storage._optionalFloat != rhs_storage._optionalFloat {return false}
  1228. if _storage._optionalDouble != rhs_storage._optionalDouble {return false}
  1229. if _storage._optionalBool != rhs_storage._optionalBool {return false}
  1230. if _storage._optionalString != rhs_storage._optionalString {return false}
  1231. if _storage._optionalBytes != rhs_storage._optionalBytes {return false}
  1232. if _storage._optionalNestedMessage != rhs_storage._optionalNestedMessage {return false}
  1233. if _storage._optionalForeignMessage != rhs_storage._optionalForeignMessage {return false}
  1234. if _storage._optionalImportMessage != rhs_storage._optionalImportMessage {return false}
  1235. if _storage._optionalNestedEnum != rhs_storage._optionalNestedEnum {return false}
  1236. if _storage._optionalForeignEnum != rhs_storage._optionalForeignEnum {return false}
  1237. if _storage._optionalStringPiece != rhs_storage._optionalStringPiece {return false}
  1238. if _storage._optionalCord != rhs_storage._optionalCord {return false}
  1239. if _storage._optionalBytesCord != rhs_storage._optionalBytesCord {return false}
  1240. if _storage._optionalPublicImportMessage != rhs_storage._optionalPublicImportMessage {return false}
  1241. if _storage._optionalLazyMessage != rhs_storage._optionalLazyMessage {return false}
  1242. if _storage._optionalUnverifiedLazyMessage != rhs_storage._optionalUnverifiedLazyMessage {return false}
  1243. if _storage._optionalLazyImportMessage != rhs_storage._optionalLazyImportMessage {return false}
  1244. if _storage._repeatedInt32 != rhs_storage._repeatedInt32 {return false}
  1245. if _storage._repeatedInt64 != rhs_storage._repeatedInt64 {return false}
  1246. if _storage._repeatedUint32 != rhs_storage._repeatedUint32 {return false}
  1247. if _storage._repeatedUint64 != rhs_storage._repeatedUint64 {return false}
  1248. if _storage._repeatedSint32 != rhs_storage._repeatedSint32 {return false}
  1249. if _storage._repeatedSint64 != rhs_storage._repeatedSint64 {return false}
  1250. if _storage._repeatedFixed32 != rhs_storage._repeatedFixed32 {return false}
  1251. if _storage._repeatedFixed64 != rhs_storage._repeatedFixed64 {return false}
  1252. if _storage._repeatedSfixed32 != rhs_storage._repeatedSfixed32 {return false}
  1253. if _storage._repeatedSfixed64 != rhs_storage._repeatedSfixed64 {return false}
  1254. if _storage._repeatedFloat != rhs_storage._repeatedFloat {return false}
  1255. if _storage._repeatedDouble != rhs_storage._repeatedDouble {return false}
  1256. if _storage._repeatedBool != rhs_storage._repeatedBool {return false}
  1257. if _storage._repeatedString != rhs_storage._repeatedString {return false}
  1258. if _storage._repeatedBytes != rhs_storage._repeatedBytes {return false}
  1259. if _storage._proto3OptionalInt32 != rhs_storage._proto3OptionalInt32 {return false}
  1260. if _storage._proto3OptionalInt64 != rhs_storage._proto3OptionalInt64 {return false}
  1261. if _storage._proto3OptionalUint32 != rhs_storage._proto3OptionalUint32 {return false}
  1262. if _storage._proto3OptionalUint64 != rhs_storage._proto3OptionalUint64 {return false}
  1263. if _storage._proto3OptionalSint32 != rhs_storage._proto3OptionalSint32 {return false}
  1264. if _storage._proto3OptionalSint64 != rhs_storage._proto3OptionalSint64 {return false}
  1265. if _storage._proto3OptionalFixed32 != rhs_storage._proto3OptionalFixed32 {return false}
  1266. if _storage._proto3OptionalFixed64 != rhs_storage._proto3OptionalFixed64 {return false}
  1267. if _storage._proto3OptionalSfixed32 != rhs_storage._proto3OptionalSfixed32 {return false}
  1268. if _storage._proto3OptionalSfixed64 != rhs_storage._proto3OptionalSfixed64 {return false}
  1269. if _storage._proto3OptionalFloat != rhs_storage._proto3OptionalFloat {return false}
  1270. if _storage._proto3OptionalDouble != rhs_storage._proto3OptionalDouble {return false}
  1271. if _storage._proto3OptionalBool != rhs_storage._proto3OptionalBool {return false}
  1272. if _storage._proto3OptionalString != rhs_storage._proto3OptionalString {return false}
  1273. if _storage._proto3OptionalBytes != rhs_storage._proto3OptionalBytes {return false}
  1274. if _storage._repeatedNestedMessage != rhs_storage._repeatedNestedMessage {return false}
  1275. if _storage._repeatedForeignMessage != rhs_storage._repeatedForeignMessage {return false}
  1276. if _storage._repeatedImportMessage != rhs_storage._repeatedImportMessage {return false}
  1277. if _storage._repeatedNestedEnum != rhs_storage._repeatedNestedEnum {return false}
  1278. if _storage._repeatedForeignEnum != rhs_storage._repeatedForeignEnum {return false}
  1279. if _storage._repeatedStringPiece != rhs_storage._repeatedStringPiece {return false}
  1280. if _storage._repeatedCord != rhs_storage._repeatedCord {return false}
  1281. if _storage._repeatedLazyMessage != rhs_storage._repeatedLazyMessage {return false}
  1282. if _storage._oneofField != rhs_storage._oneofField {return false}
  1283. return true
  1284. }
  1285. if !storagesAreEqual {return false}
  1286. }
  1287. if lhs.unknownFields != rhs.unknownFields {return false}
  1288. return true
  1289. }
  1290. }
  1291. extension Proto3ArenaUnittest_TestAllTypes.NestedEnum: SwiftProtobuf._ProtoNameProviding {
  1292. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1293. -1: .same(proto: "NEG"),
  1294. 0: .same(proto: "ZERO"),
  1295. 1: .same(proto: "FOO"),
  1296. 2: .same(proto: "BAR"),
  1297. 3: .same(proto: "BAZ"),
  1298. ]
  1299. }
  1300. extension Proto3ArenaUnittest_TestAllTypes.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1301. static let protoMessageName: String = Proto3ArenaUnittest_TestAllTypes.protoMessageName + ".NestedMessage"
  1302. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1303. 1: .same(proto: "bb"),
  1304. ]
  1305. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1306. while let fieldNumber = try decoder.nextFieldNumber() {
  1307. // The use of inline closures is to circumvent an issue where the compiler
  1308. // allocates stack space for every case branch when no optimizations are
  1309. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1310. switch fieldNumber {
  1311. case 1: try { try decoder.decodeSingularInt32Field(value: &self.bb) }()
  1312. default: break
  1313. }
  1314. }
  1315. }
  1316. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1317. if self.bb != 0 {
  1318. try visitor.visitSingularInt32Field(value: self.bb, fieldNumber: 1)
  1319. }
  1320. try unknownFields.traverse(visitor: &visitor)
  1321. }
  1322. static func ==(lhs: Proto3ArenaUnittest_TestAllTypes.NestedMessage, rhs: Proto3ArenaUnittest_TestAllTypes.NestedMessage) -> Bool {
  1323. if lhs.bb != rhs.bb {return false}
  1324. if lhs.unknownFields != rhs.unknownFields {return false}
  1325. return true
  1326. }
  1327. }
  1328. extension Proto3ArenaUnittest_TestPackedTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1329. static let protoMessageName: String = _protobuf_package + ".TestPackedTypes"
  1330. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1331. 90: .standard(proto: "packed_int32"),
  1332. 91: .standard(proto: "packed_int64"),
  1333. 92: .standard(proto: "packed_uint32"),
  1334. 93: .standard(proto: "packed_uint64"),
  1335. 94: .standard(proto: "packed_sint32"),
  1336. 95: .standard(proto: "packed_sint64"),
  1337. 96: .standard(proto: "packed_fixed32"),
  1338. 97: .standard(proto: "packed_fixed64"),
  1339. 98: .standard(proto: "packed_sfixed32"),
  1340. 99: .standard(proto: "packed_sfixed64"),
  1341. 100: .standard(proto: "packed_float"),
  1342. 101: .standard(proto: "packed_double"),
  1343. 102: .standard(proto: "packed_bool"),
  1344. 103: .standard(proto: "packed_enum"),
  1345. ]
  1346. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1347. while let fieldNumber = try decoder.nextFieldNumber() {
  1348. // The use of inline closures is to circumvent an issue where the compiler
  1349. // allocates stack space for every case branch when no optimizations are
  1350. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1351. switch fieldNumber {
  1352. case 90: try { try decoder.decodeRepeatedInt32Field(value: &self.packedInt32) }()
  1353. case 91: try { try decoder.decodeRepeatedInt64Field(value: &self.packedInt64) }()
  1354. case 92: try { try decoder.decodeRepeatedUInt32Field(value: &self.packedUint32) }()
  1355. case 93: try { try decoder.decodeRepeatedUInt64Field(value: &self.packedUint64) }()
  1356. case 94: try { try decoder.decodeRepeatedSInt32Field(value: &self.packedSint32) }()
  1357. case 95: try { try decoder.decodeRepeatedSInt64Field(value: &self.packedSint64) }()
  1358. case 96: try { try decoder.decodeRepeatedFixed32Field(value: &self.packedFixed32) }()
  1359. case 97: try { try decoder.decodeRepeatedFixed64Field(value: &self.packedFixed64) }()
  1360. case 98: try { try decoder.decodeRepeatedSFixed32Field(value: &self.packedSfixed32) }()
  1361. case 99: try { try decoder.decodeRepeatedSFixed64Field(value: &self.packedSfixed64) }()
  1362. case 100: try { try decoder.decodeRepeatedFloatField(value: &self.packedFloat) }()
  1363. case 101: try { try decoder.decodeRepeatedDoubleField(value: &self.packedDouble) }()
  1364. case 102: try { try decoder.decodeRepeatedBoolField(value: &self.packedBool) }()
  1365. case 103: try { try decoder.decodeRepeatedEnumField(value: &self.packedEnum) }()
  1366. default: break
  1367. }
  1368. }
  1369. }
  1370. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1371. if !self.packedInt32.isEmpty {
  1372. try visitor.visitPackedInt32Field(value: self.packedInt32, fieldNumber: 90)
  1373. }
  1374. if !self.packedInt64.isEmpty {
  1375. try visitor.visitPackedInt64Field(value: self.packedInt64, fieldNumber: 91)
  1376. }
  1377. if !self.packedUint32.isEmpty {
  1378. try visitor.visitPackedUInt32Field(value: self.packedUint32, fieldNumber: 92)
  1379. }
  1380. if !self.packedUint64.isEmpty {
  1381. try visitor.visitPackedUInt64Field(value: self.packedUint64, fieldNumber: 93)
  1382. }
  1383. if !self.packedSint32.isEmpty {
  1384. try visitor.visitPackedSInt32Field(value: self.packedSint32, fieldNumber: 94)
  1385. }
  1386. if !self.packedSint64.isEmpty {
  1387. try visitor.visitPackedSInt64Field(value: self.packedSint64, fieldNumber: 95)
  1388. }
  1389. if !self.packedFixed32.isEmpty {
  1390. try visitor.visitPackedFixed32Field(value: self.packedFixed32, fieldNumber: 96)
  1391. }
  1392. if !self.packedFixed64.isEmpty {
  1393. try visitor.visitPackedFixed64Field(value: self.packedFixed64, fieldNumber: 97)
  1394. }
  1395. if !self.packedSfixed32.isEmpty {
  1396. try visitor.visitPackedSFixed32Field(value: self.packedSfixed32, fieldNumber: 98)
  1397. }
  1398. if !self.packedSfixed64.isEmpty {
  1399. try visitor.visitPackedSFixed64Field(value: self.packedSfixed64, fieldNumber: 99)
  1400. }
  1401. if !self.packedFloat.isEmpty {
  1402. try visitor.visitPackedFloatField(value: self.packedFloat, fieldNumber: 100)
  1403. }
  1404. if !self.packedDouble.isEmpty {
  1405. try visitor.visitPackedDoubleField(value: self.packedDouble, fieldNumber: 101)
  1406. }
  1407. if !self.packedBool.isEmpty {
  1408. try visitor.visitPackedBoolField(value: self.packedBool, fieldNumber: 102)
  1409. }
  1410. if !self.packedEnum.isEmpty {
  1411. try visitor.visitPackedEnumField(value: self.packedEnum, fieldNumber: 103)
  1412. }
  1413. try unknownFields.traverse(visitor: &visitor)
  1414. }
  1415. static func ==(lhs: Proto3ArenaUnittest_TestPackedTypes, rhs: Proto3ArenaUnittest_TestPackedTypes) -> Bool {
  1416. if lhs.packedInt32 != rhs.packedInt32 {return false}
  1417. if lhs.packedInt64 != rhs.packedInt64 {return false}
  1418. if lhs.packedUint32 != rhs.packedUint32 {return false}
  1419. if lhs.packedUint64 != rhs.packedUint64 {return false}
  1420. if lhs.packedSint32 != rhs.packedSint32 {return false}
  1421. if lhs.packedSint64 != rhs.packedSint64 {return false}
  1422. if lhs.packedFixed32 != rhs.packedFixed32 {return false}
  1423. if lhs.packedFixed64 != rhs.packedFixed64 {return false}
  1424. if lhs.packedSfixed32 != rhs.packedSfixed32 {return false}
  1425. if lhs.packedSfixed64 != rhs.packedSfixed64 {return false}
  1426. if lhs.packedFloat != rhs.packedFloat {return false}
  1427. if lhs.packedDouble != rhs.packedDouble {return false}
  1428. if lhs.packedBool != rhs.packedBool {return false}
  1429. if lhs.packedEnum != rhs.packedEnum {return false}
  1430. if lhs.unknownFields != rhs.unknownFields {return false}
  1431. return true
  1432. }
  1433. }
  1434. extension Proto3ArenaUnittest_TestUnpackedTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1435. static let protoMessageName: String = _protobuf_package + ".TestUnpackedTypes"
  1436. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1437. 1: .standard(proto: "repeated_int32"),
  1438. 2: .standard(proto: "repeated_int64"),
  1439. 3: .standard(proto: "repeated_uint32"),
  1440. 4: .standard(proto: "repeated_uint64"),
  1441. 5: .standard(proto: "repeated_sint32"),
  1442. 6: .standard(proto: "repeated_sint64"),
  1443. 7: .standard(proto: "repeated_fixed32"),
  1444. 8: .standard(proto: "repeated_fixed64"),
  1445. 9: .standard(proto: "repeated_sfixed32"),
  1446. 10: .standard(proto: "repeated_sfixed64"),
  1447. 11: .standard(proto: "repeated_float"),
  1448. 12: .standard(proto: "repeated_double"),
  1449. 13: .standard(proto: "repeated_bool"),
  1450. 14: .standard(proto: "repeated_nested_enum"),
  1451. ]
  1452. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1453. while let fieldNumber = try decoder.nextFieldNumber() {
  1454. // The use of inline closures is to circumvent an issue where the compiler
  1455. // allocates stack space for every case branch when no optimizations are
  1456. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1457. switch fieldNumber {
  1458. case 1: try { try decoder.decodeRepeatedInt32Field(value: &self.repeatedInt32) }()
  1459. case 2: try { try decoder.decodeRepeatedInt64Field(value: &self.repeatedInt64) }()
  1460. case 3: try { try decoder.decodeRepeatedUInt32Field(value: &self.repeatedUint32) }()
  1461. case 4: try { try decoder.decodeRepeatedUInt64Field(value: &self.repeatedUint64) }()
  1462. case 5: try { try decoder.decodeRepeatedSInt32Field(value: &self.repeatedSint32) }()
  1463. case 6: try { try decoder.decodeRepeatedSInt64Field(value: &self.repeatedSint64) }()
  1464. case 7: try { try decoder.decodeRepeatedFixed32Field(value: &self.repeatedFixed32) }()
  1465. case 8: try { try decoder.decodeRepeatedFixed64Field(value: &self.repeatedFixed64) }()
  1466. case 9: try { try decoder.decodeRepeatedSFixed32Field(value: &self.repeatedSfixed32) }()
  1467. case 10: try { try decoder.decodeRepeatedSFixed64Field(value: &self.repeatedSfixed64) }()
  1468. case 11: try { try decoder.decodeRepeatedFloatField(value: &self.repeatedFloat) }()
  1469. case 12: try { try decoder.decodeRepeatedDoubleField(value: &self.repeatedDouble) }()
  1470. case 13: try { try decoder.decodeRepeatedBoolField(value: &self.repeatedBool) }()
  1471. case 14: try { try decoder.decodeRepeatedEnumField(value: &self.repeatedNestedEnum) }()
  1472. default: break
  1473. }
  1474. }
  1475. }
  1476. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1477. if !self.repeatedInt32.isEmpty {
  1478. try visitor.visitRepeatedInt32Field(value: self.repeatedInt32, fieldNumber: 1)
  1479. }
  1480. if !self.repeatedInt64.isEmpty {
  1481. try visitor.visitRepeatedInt64Field(value: self.repeatedInt64, fieldNumber: 2)
  1482. }
  1483. if !self.repeatedUint32.isEmpty {
  1484. try visitor.visitRepeatedUInt32Field(value: self.repeatedUint32, fieldNumber: 3)
  1485. }
  1486. if !self.repeatedUint64.isEmpty {
  1487. try visitor.visitRepeatedUInt64Field(value: self.repeatedUint64, fieldNumber: 4)
  1488. }
  1489. if !self.repeatedSint32.isEmpty {
  1490. try visitor.visitRepeatedSInt32Field(value: self.repeatedSint32, fieldNumber: 5)
  1491. }
  1492. if !self.repeatedSint64.isEmpty {
  1493. try visitor.visitRepeatedSInt64Field(value: self.repeatedSint64, fieldNumber: 6)
  1494. }
  1495. if !self.repeatedFixed32.isEmpty {
  1496. try visitor.visitRepeatedFixed32Field(value: self.repeatedFixed32, fieldNumber: 7)
  1497. }
  1498. if !self.repeatedFixed64.isEmpty {
  1499. try visitor.visitRepeatedFixed64Field(value: self.repeatedFixed64, fieldNumber: 8)
  1500. }
  1501. if !self.repeatedSfixed32.isEmpty {
  1502. try visitor.visitRepeatedSFixed32Field(value: self.repeatedSfixed32, fieldNumber: 9)
  1503. }
  1504. if !self.repeatedSfixed64.isEmpty {
  1505. try visitor.visitRepeatedSFixed64Field(value: self.repeatedSfixed64, fieldNumber: 10)
  1506. }
  1507. if !self.repeatedFloat.isEmpty {
  1508. try visitor.visitRepeatedFloatField(value: self.repeatedFloat, fieldNumber: 11)
  1509. }
  1510. if !self.repeatedDouble.isEmpty {
  1511. try visitor.visitRepeatedDoubleField(value: self.repeatedDouble, fieldNumber: 12)
  1512. }
  1513. if !self.repeatedBool.isEmpty {
  1514. try visitor.visitRepeatedBoolField(value: self.repeatedBool, fieldNumber: 13)
  1515. }
  1516. if !self.repeatedNestedEnum.isEmpty {
  1517. try visitor.visitRepeatedEnumField(value: self.repeatedNestedEnum, fieldNumber: 14)
  1518. }
  1519. try unknownFields.traverse(visitor: &visitor)
  1520. }
  1521. static func ==(lhs: Proto3ArenaUnittest_TestUnpackedTypes, rhs: Proto3ArenaUnittest_TestUnpackedTypes) -> Bool {
  1522. if lhs.repeatedInt32 != rhs.repeatedInt32 {return false}
  1523. if lhs.repeatedInt64 != rhs.repeatedInt64 {return false}
  1524. if lhs.repeatedUint32 != rhs.repeatedUint32 {return false}
  1525. if lhs.repeatedUint64 != rhs.repeatedUint64 {return false}
  1526. if lhs.repeatedSint32 != rhs.repeatedSint32 {return false}
  1527. if lhs.repeatedSint64 != rhs.repeatedSint64 {return false}
  1528. if lhs.repeatedFixed32 != rhs.repeatedFixed32 {return false}
  1529. if lhs.repeatedFixed64 != rhs.repeatedFixed64 {return false}
  1530. if lhs.repeatedSfixed32 != rhs.repeatedSfixed32 {return false}
  1531. if lhs.repeatedSfixed64 != rhs.repeatedSfixed64 {return false}
  1532. if lhs.repeatedFloat != rhs.repeatedFloat {return false}
  1533. if lhs.repeatedDouble != rhs.repeatedDouble {return false}
  1534. if lhs.repeatedBool != rhs.repeatedBool {return false}
  1535. if lhs.repeatedNestedEnum != rhs.repeatedNestedEnum {return false}
  1536. if lhs.unknownFields != rhs.unknownFields {return false}
  1537. return true
  1538. }
  1539. }
  1540. extension Proto3ArenaUnittest_NestedTestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1541. static let protoMessageName: String = _protobuf_package + ".NestedTestAllTypes"
  1542. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1543. 1: .same(proto: "child"),
  1544. 2: .same(proto: "payload"),
  1545. 3: .standard(proto: "repeated_child"),
  1546. 4: .standard(proto: "lazy_payload"),
  1547. ]
  1548. fileprivate class _StorageClass {
  1549. var _child: Proto3ArenaUnittest_NestedTestAllTypes? = nil
  1550. var _payload: Proto3ArenaUnittest_TestAllTypes? = nil
  1551. var _repeatedChild: [Proto3ArenaUnittest_NestedTestAllTypes] = []
  1552. var _lazyPayload: Proto3ArenaUnittest_TestAllTypes? = nil
  1553. // This property is used as the initial default value for new instances of the type.
  1554. // The type itself is protecting the reference to its storage via CoW semantics.
  1555. // This will force a copy to be made of this reference when the first mutation occurs;
  1556. // hence, it is safe to mark this as `nonisolated(unsafe)`.
  1557. static nonisolated(unsafe) let defaultInstance = _StorageClass()
  1558. private init() {}
  1559. init(copying source: _StorageClass) {
  1560. _child = source._child
  1561. _payload = source._payload
  1562. _repeatedChild = source._repeatedChild
  1563. _lazyPayload = source._lazyPayload
  1564. }
  1565. }
  1566. fileprivate mutating func _uniqueStorage() -> _StorageClass {
  1567. if !isKnownUniquelyReferenced(&_storage) {
  1568. _storage = _StorageClass(copying: _storage)
  1569. }
  1570. return _storage
  1571. }
  1572. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1573. _ = _uniqueStorage()
  1574. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  1575. while let fieldNumber = try decoder.nextFieldNumber() {
  1576. // The use of inline closures is to circumvent an issue where the compiler
  1577. // allocates stack space for every case branch when no optimizations are
  1578. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1579. switch fieldNumber {
  1580. case 1: try { try decoder.decodeSingularMessageField(value: &_storage._child) }()
  1581. case 2: try { try decoder.decodeSingularMessageField(value: &_storage._payload) }()
  1582. case 3: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedChild) }()
  1583. case 4: try { try decoder.decodeSingularMessageField(value: &_storage._lazyPayload) }()
  1584. default: break
  1585. }
  1586. }
  1587. }
  1588. }
  1589. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1590. try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
  1591. // The use of inline closures is to circumvent an issue where the compiler
  1592. // allocates stack space for every if/case branch local when no optimizations
  1593. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  1594. // https://github.com/apple/swift-protobuf/issues/1182
  1595. try { if let v = _storage._child {
  1596. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  1597. } }()
  1598. try { if let v = _storage._payload {
  1599. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  1600. } }()
  1601. if !_storage._repeatedChild.isEmpty {
  1602. try visitor.visitRepeatedMessageField(value: _storage._repeatedChild, fieldNumber: 3)
  1603. }
  1604. try { if let v = _storage._lazyPayload {
  1605. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  1606. } }()
  1607. }
  1608. try unknownFields.traverse(visitor: &visitor)
  1609. }
  1610. static func ==(lhs: Proto3ArenaUnittest_NestedTestAllTypes, rhs: Proto3ArenaUnittest_NestedTestAllTypes) -> Bool {
  1611. if lhs._storage !== rhs._storage {
  1612. let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
  1613. let _storage = _args.0
  1614. let rhs_storage = _args.1
  1615. if _storage._child != rhs_storage._child {return false}
  1616. if _storage._payload != rhs_storage._payload {return false}
  1617. if _storage._repeatedChild != rhs_storage._repeatedChild {return false}
  1618. if _storage._lazyPayload != rhs_storage._lazyPayload {return false}
  1619. return true
  1620. }
  1621. if !storagesAreEqual {return false}
  1622. }
  1623. if lhs.unknownFields != rhs.unknownFields {return false}
  1624. return true
  1625. }
  1626. }
  1627. extension Proto3ArenaUnittest_ForeignMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1628. static let protoMessageName: String = _protobuf_package + ".ForeignMessage"
  1629. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1630. 1: .same(proto: "c"),
  1631. ]
  1632. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1633. while let fieldNumber = try decoder.nextFieldNumber() {
  1634. // The use of inline closures is to circumvent an issue where the compiler
  1635. // allocates stack space for every case branch when no optimizations are
  1636. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1637. switch fieldNumber {
  1638. case 1: try { try decoder.decodeSingularInt32Field(value: &self.c) }()
  1639. default: break
  1640. }
  1641. }
  1642. }
  1643. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1644. if self.c != 0 {
  1645. try visitor.visitSingularInt32Field(value: self.c, fieldNumber: 1)
  1646. }
  1647. try unknownFields.traverse(visitor: &visitor)
  1648. }
  1649. static func ==(lhs: Proto3ArenaUnittest_ForeignMessage, rhs: Proto3ArenaUnittest_ForeignMessage) -> Bool {
  1650. if lhs.c != rhs.c {return false}
  1651. if lhs.unknownFields != rhs.unknownFields {return false}
  1652. return true
  1653. }
  1654. }
  1655. extension Proto3ArenaUnittest_TestEmptyMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1656. static let protoMessageName: String = _protobuf_package + ".TestEmptyMessage"
  1657. static let _protobuf_nameMap = SwiftProtobuf._NameMap()
  1658. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1659. // Load everything into unknown fields
  1660. while try decoder.nextFieldNumber() != nil {}
  1661. }
  1662. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1663. try unknownFields.traverse(visitor: &visitor)
  1664. }
  1665. static func ==(lhs: Proto3ArenaUnittest_TestEmptyMessage, rhs: Proto3ArenaUnittest_TestEmptyMessage) -> Bool {
  1666. if lhs.unknownFields != rhs.unknownFields {return false}
  1667. return true
  1668. }
  1669. }
  1670. extension Proto3ArenaUnittest_TestPickleNestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1671. static let protoMessageName: String = _protobuf_package + ".TestPickleNestedMessage"
  1672. static let _protobuf_nameMap = SwiftProtobuf._NameMap()
  1673. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1674. // Load everything into unknown fields
  1675. while try decoder.nextFieldNumber() != nil {}
  1676. }
  1677. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1678. try unknownFields.traverse(visitor: &visitor)
  1679. }
  1680. static func ==(lhs: Proto3ArenaUnittest_TestPickleNestedMessage, rhs: Proto3ArenaUnittest_TestPickleNestedMessage) -> Bool {
  1681. if lhs.unknownFields != rhs.unknownFields {return false}
  1682. return true
  1683. }
  1684. }
  1685. extension Proto3ArenaUnittest_TestPickleNestedMessage.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1686. static let protoMessageName: String = Proto3ArenaUnittest_TestPickleNestedMessage.protoMessageName + ".NestedMessage"
  1687. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1688. 1: .same(proto: "bb"),
  1689. ]
  1690. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1691. while let fieldNumber = try decoder.nextFieldNumber() {
  1692. // The use of inline closures is to circumvent an issue where the compiler
  1693. // allocates stack space for every case branch when no optimizations are
  1694. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1695. switch fieldNumber {
  1696. case 1: try { try decoder.decodeSingularInt32Field(value: &self.bb) }()
  1697. default: break
  1698. }
  1699. }
  1700. }
  1701. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1702. if self.bb != 0 {
  1703. try visitor.visitSingularInt32Field(value: self.bb, fieldNumber: 1)
  1704. }
  1705. try unknownFields.traverse(visitor: &visitor)
  1706. }
  1707. static func ==(lhs: Proto3ArenaUnittest_TestPickleNestedMessage.NestedMessage, rhs: Proto3ArenaUnittest_TestPickleNestedMessage.NestedMessage) -> Bool {
  1708. if lhs.bb != rhs.bb {return false}
  1709. if lhs.unknownFields != rhs.unknownFields {return false}
  1710. return true
  1711. }
  1712. }
  1713. extension Proto3ArenaUnittest_TestPickleNestedMessage.NestedMessage.NestedNestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  1714. static let protoMessageName: String = Proto3ArenaUnittest_TestPickleNestedMessage.NestedMessage.protoMessageName + ".NestedNestedMessage"
  1715. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  1716. 1: .same(proto: "cc"),
  1717. ]
  1718. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  1719. while let fieldNumber = try decoder.nextFieldNumber() {
  1720. // The use of inline closures is to circumvent an issue where the compiler
  1721. // allocates stack space for every case branch when no optimizations are
  1722. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  1723. switch fieldNumber {
  1724. case 1: try { try decoder.decodeSingularInt32Field(value: &self.cc) }()
  1725. default: break
  1726. }
  1727. }
  1728. }
  1729. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  1730. if self.cc != 0 {
  1731. try visitor.visitSingularInt32Field(value: self.cc, fieldNumber: 1)
  1732. }
  1733. try unknownFields.traverse(visitor: &visitor)
  1734. }
  1735. static func ==(lhs: Proto3ArenaUnittest_TestPickleNestedMessage.NestedMessage.NestedNestedMessage, rhs: Proto3ArenaUnittest_TestPickleNestedMessage.NestedMessage.NestedNestedMessage) -> Bool {
  1736. if lhs.cc != rhs.cc {return false}
  1737. if lhs.unknownFields != rhs.unknownFields {return false}
  1738. return true
  1739. }
  1740. }