Parcourir la source

Bring over conformance test runner from apple/swift-protobuf-test-conformance (#162)

* Copy conformance test runner into runtime/plugin project.
* Update package manifest to include Conformance.
* Update Makefile to regenerate and run conformance tests.
Tony Allevato il y a 9 ans
Parent
commit
fd2664a885

+ 4 - 0
.gitignore

@@ -5,3 +5,7 @@
 xcuserdata
 /_test
 protoc-gen-swift
+
+# Intermediate conformance test outputs
+failing_tests.txt
+nonexistent_tests.txt

+ 59 - 0
Documentation/CONFORMANCE_TESTS.md

@@ -0,0 +1,59 @@
+# Swift Protobuf Conformance Tester
+
+**Welcome to Swift Protobuf!**
+
+Apple's Swift programming language is a perfect complement to Google's Protocol Buffer serialization technology.  They both emphasize high performance and programmer safety.
+
+Google's protobuf project includes a conformance checking host program that generates a large number of test cases, feeds them to a test program that executes those test cases, then verifies the results.  This project provides the test program for Swift Protobuf that works with Google's conformance checking host to verify that Swift Protobuf is completely compatible with other implementations of Google's protobuf specification.
+
+## Requirements
+
+This test suite requires Swift 3.0, standard command-line tools such as make and awk, and a full source checkout of [Google's protobuf project](https://github.com/google/protobuf).
+
+## Building the Tests
+
+The `Makefile` at the root of this project has the following lines, which specify how to run the installed `protoc` program on your system, and where to find the Google protobuf source tree:
+```Makefile
+PROTOC=protoc
+GOOGLE_PROTOBUFS_CHECKOUT=../protobuf
+```
+
+If these do not match your system, you can run `make [target] PROTOC=[path] GOOGLE_PROTOBUFS_CHECKOUT=[path]`, or edit the `Makefile` directly if you prefer.
+
+After setting these variables, you can type:
+```console
+$ make test-conformance
+```
+
+which will build Google's conformance host program (which manages the conformance test process) and the Swift Protobuf conformance checker (which executes the individual test cases).
+
+It will then run the test suite and print out any discrepancies found by the tool.
+
+## If you have problems
+
+The most common problem area is building Google's conformance host program.  You may find it easier to switch to the directory where you have checked out Google's protobuf sources and build the host program manually:
+```console
+$ cd protobuf
+$ ./configure
+$ make -C src
+$ make -C conformance
+```
+
+You can then manually run the conformance test using the following commands:
+```console
+$ cd swift-protobuf
+$ ../protobuf/conformance/conformance-test-runner --failure_list failure_list_swift.txt .build/debug/Conformance
+```
+
+## Known Issues
+
+The conformance test may print out a non-zero of "expected failures".  For more details on these, please look at `failure_list_swift.txt` which lists the tests that are expected to fail and includes some explanation.
+
+## Report any issues
+
+If the conformance test prints out any "unexpected failures", please look in the Github Issues to see if the problem you're seeing was already reported.  If not, please send us a detailed report, including:
+* The specific operating system and version (for example, "macOS 10.12.1" or "Ubuntu 15.10")
+* The version of Swift you have installed (from `swift --version`)
+* The version of the protobuf source code you are working with (look at the AC_INIT line near the top of configure.ac)
+* The full output of the conformance test run, starting with "CONFORMANCE TEST BEGIN"
+

+ 45 - 1
Makefile

@@ -53,6 +53,14 @@ PROTOC_GEN_SWIFT=.build/debug/protoc-gen-swift
 GENERATE_SRCS_BASE=${PROTOC} --plugin=protoc-gen-tfiws=${PROTOC_GEN_SWIFT}
 GENERATE_SRCS=${GENERATE_SRCS_BASE} -I Protos
 
+# Where to find the Swift conformance test runner executable.
+SWIFT_CONFORMANCE_PLUGIN = .build/debug/Conformance
+
+# If you have already build conformance-test-runner in
+# a nearby directory, just set the full path here and
+# we'll use it instead.
+CONFORMANCE_HOST = ${GOOGLE_PROTOBUFS_CHECKOUT}/conformance/conformance-test-runner
+
 # NOTE: TEST_PROTOS, LIBRARY_PROTOS, and PLUGIN_PROTOS are all full paths so
 # eventually we might be able to do proper dependencies and use them as inputs
 # for other rules (we'll also likely need outputs).
@@ -138,6 +146,10 @@ PLUGIN_PROTOS= \
 	Protos/google/protobuf/compiler/plugin.proto \
 	Protos/google/protobuf/descriptor.proto
 
+# Protos that are used by the conformance test runner.
+CONFORMANCE_PROTOS= \
+	Protos/conformance/conformance.proto
+
 XCODEBUILD_EXTRAS =
 # Invoke make with XCODE_SKIP_OPTIMIZER=1 to suppress the optimizer when
 # building the Xcode projects. For Release builds, this is a non trivial speed
@@ -159,10 +171,12 @@ endif
 	build \
 	check \
 	clean \
+	conformance-host \
 	default \
 	install \
 	reference \
 	regenerate \
+	regenerate-conformance-protos \
 	regenerate-library-protos \
 	regenerate-plugin-protos \
 	regenerate-test-protos \
@@ -305,7 +319,7 @@ reference: build
 #  * protoc is built and installed
 #  * PROTOC at the top of this file is set correctly
 #
-regenerate: regenerate-library-protos regenerate-plugin-protos regenerate-test-protos
+regenerate: regenerate-library-protos regenerate-plugin-protos regenerate-test-protos regenerate-conformance-protos
 
 # Rebuild just the protos included in the runtime library
 regenerate-library-protos: build
@@ -324,6 +338,10 @@ regenerate-test-protos: build
 		${GENERATE_SRCS} --tfiws_out=FileNaming=DropPath:Tests/SwiftProtobufTests $$t; \
 	done
 
+# Rebuild just the protos used by the conformance test runner.
+regenerate-conformance-protos: build
+	${GENERATE_SRCS} --tfiws_out=FileNaming=DropPath:Sources/Conformance ${CONFORMANCE_PROTOS}
+
 #
 # Helper to update the .proto files copied from the google/protobufs distro.
 #
@@ -346,6 +364,32 @@ update-proto-files:
 	@echo 'option swift_prefix = "Proto3";' >> Protos/google/protobuf/unittest_import_public_proto3.proto
 	@echo 'option swift_prefix = "Proto3";' >> Protos/google/protobuf/unittest_proto3.proto
 
+SWIFT_CONFORMANCE_PLUGIN_SOURCES= \
+	Sources/Conformance/conformance.pb.swift \
+	Sources/Conformance/main.swift
+
+$(SWIFT_CONFORMANCE_PLUGIN): $(SWIFT_CONFORMANCE_PLUGIN_SOURCES)
+	${SWIFT} build
+
+# Runs the conformance tests.
+test-conformance: $(SWIFT_CONFORMANCE_PLUGIN) $(CONFORMANCE_HOST) failure_list_swift.txt
+	( \
+		ABS_PBDIR=`cd ${GOOGLE_PROTOBUFS_CHECKOUT}; pwd`; \
+		$${ABS_PBDIR}/conformance/conformance-test-runner --failure_list failure_list_swift.txt $(SWIFT_CONFORMANCE_PLUGIN); \
+	)
+
+# The 'conformance-host' program is part of the protobuf project.
+# It generates test cases, feeds them to our plugin, and verifies the results:
+conformance-host: $(CONFORMANCE_HOST)
+
+$(CONFORMANCE_HOST):
+	( \
+		cd ${GOOGLE_PROTOBUFS_CHECKOUT}; \
+		./configure; \
+		$(MAKE) -C src; \
+		$(MAKE) -C conformance; \
+	)
+
 
 # Helpers to put the Xcode project through all modes.
 

+ 12 - 6
Package.swift

@@ -1,14 +1,20 @@
 import PackageDescription
 
 let package = Package(
-    name: "SwiftProtobuf",
-    targets: [
-        Target(name: "PluginLibrary", dependencies: ["SwiftProtobuf"]),
-        Target(name: "protoc-gen-swift", dependencies: ["PluginLibrary", "SwiftProtobuf"]),
-    ]
+  name: "SwiftProtobuf",
+  targets: [
+    Target(name: "PluginLibrary",
+           dependencies: ["SwiftProtobuf"]),
+    Target(name: "protoc-gen-swift",
+           dependencies: ["PluginLibrary", "SwiftProtobuf"]),
+    Target(name: "Conformance",
+           dependencies: ["SwiftProtobuf"]),
+  ]
 )
 
 // Ensure that the dynamic library is created for the performance test harness.
 products.append(
-    Product(name: "SwiftProtobuf", type: .Library(.Dynamic), modules: "SwiftProtobuf")
+  Product(name: "SwiftProtobuf",
+          type: .Library(.Dynamic),
+          modules: "SwiftProtobuf")
 )

+ 2647 - 0
Sources/Conformance/conformance.pb.swift

@@ -0,0 +1,2647 @@
+/*
+ * DO NOT EDIT.
+ *
+ * Generated by the protocol buffer compiler.
+ * Source: conformance/conformance.proto
+ *
+ */
+
+//  Protocol Buffers - Google's data interchange format
+//  Copyright 2008 Google Inc.  All rights reserved.
+//  https://developers.google.com/protocol-buffers/
+// 
+//  Redistribution and use in source and binary forms, with or without
+//  modification, are permitted provided that the following conditions are
+//  met:
+// 
+//      * Redistributions of source code must retain the above copyright
+//  notice, this list of conditions and the following disclaimer.
+//      * Redistributions in binary form must reproduce the above
+//  copyright notice, this list of conditions and the following disclaimer
+//  in the documentation and/or other materials provided with the
+//  distribution.
+//      * Neither the name of Google Inc. nor the names of its
+//  contributors may be used to endorse or promote products derived from
+//  this software without specific prior written permission.
+// 
+//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+//  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+//  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+//  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+//  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+//  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+//  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+//  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import Foundation
+import SwiftProtobuf
+
+
+//  This defines the conformance testing protocol.  This protocol exists between
+//  the conformance test suite itself and the code being tested.  For each test,
+//  the suite will send a ConformanceRequest message and expect a
+//  ConformanceResponse message.
+// 
+//  You can either run the tests in two different ways:
+// 
+//    1. in-process (using the interface in conformance_test.h).
+// 
+//    2. as a sub-process communicating over a pipe.  Information about how to
+//       do this is in conformance_test_runner.cc.
+// 
+//  Pros/cons of the two approaches:
+// 
+//    - running as a sub-process is much simpler for languages other than C/C++.
+// 
+//    - running as a sub-process may be more tricky in unusual environments like
+//      iOS apps, where fork/stdin/stdout are not available.
+
+public enum Conformance_WireFormat: SwiftProtobuf.Enum {
+  public typealias RawValue = Int
+  case unspecified // = 0
+  case protobuf // = 1
+  case json_ // = 2
+  case UNRECOGNIZED(Int)
+
+  public init() {
+    self = .unspecified
+  }
+
+  public init?(rawValue: Int) {
+    switch rawValue {
+    case 0: self = .unspecified
+    case 1: self = .protobuf
+    case 2: self = .json_
+    default: self = .UNRECOGNIZED(rawValue)
+    }
+  }
+
+  public init?(name: String) {
+    switch name {
+    case "unspecified": self = .unspecified
+    case "protobuf": self = .protobuf
+    case "json_": self = .json_
+    default: return nil
+    }
+  }
+
+  public init?(jsonName: String) {
+    switch jsonName {
+    case "UNSPECIFIED": self = .unspecified
+    case "PROTOBUF": self = .protobuf
+    case "JSON": self = .json_
+    default: return nil
+    }
+  }
+
+  public init?(protoName: String) {
+    switch protoName {
+    case "UNSPECIFIED": self = .unspecified
+    case "PROTOBUF": self = .protobuf
+    case "JSON": self = .json_
+    default: return nil
+    }
+  }
+
+  public var rawValue: Int {
+    get {
+      switch self {
+      case .unspecified: return 0
+      case .protobuf: return 1
+      case .json_: return 2
+      case .UNRECOGNIZED(let i): return i
+      }
+    }
+  }
+
+  public var json: String {
+    get {
+      switch self {
+      case .unspecified: return "\"UNSPECIFIED\""
+      case .protobuf: return "\"PROTOBUF\""
+      case .json_: return "\"JSON\""
+      case .UNRECOGNIZED(let i): return String(i)
+      }
+    }
+  }
+
+  public var hashValue: Int { return rawValue }
+
+  public var debugDescription: String {
+    get {
+      switch self {
+      case .unspecified: return ".unspecified"
+      case .protobuf: return ".protobuf"
+      case .json_: return ".json_"
+      case .UNRECOGNIZED(let v): return ".UNRECOGNIZED(\(v))"
+      }
+    }
+  }
+
+}
+
+public enum Conformance_ForeignEnum: SwiftProtobuf.Enum {
+  public typealias RawValue = Int
+  case foreignFoo // = 0
+  case foreignBar // = 1
+  case foreignBaz // = 2
+  case UNRECOGNIZED(Int)
+
+  public init() {
+    self = .foreignFoo
+  }
+
+  public init?(rawValue: Int) {
+    switch rawValue {
+    case 0: self = .foreignFoo
+    case 1: self = .foreignBar
+    case 2: self = .foreignBaz
+    default: self = .UNRECOGNIZED(rawValue)
+    }
+  }
+
+  public init?(name: String) {
+    switch name {
+    case "foreignFoo": self = .foreignFoo
+    case "foreignBar": self = .foreignBar
+    case "foreignBaz": self = .foreignBaz
+    default: return nil
+    }
+  }
+
+  public init?(jsonName: String) {
+    switch jsonName {
+    case "FOREIGN_FOO": self = .foreignFoo
+    case "FOREIGN_BAR": self = .foreignBar
+    case "FOREIGN_BAZ": self = .foreignBaz
+    default: return nil
+    }
+  }
+
+  public init?(protoName: String) {
+    switch protoName {
+    case "FOREIGN_FOO": self = .foreignFoo
+    case "FOREIGN_BAR": self = .foreignBar
+    case "FOREIGN_BAZ": self = .foreignBaz
+    default: return nil
+    }
+  }
+
+  public var rawValue: Int {
+    get {
+      switch self {
+      case .foreignFoo: return 0
+      case .foreignBar: return 1
+      case .foreignBaz: return 2
+      case .UNRECOGNIZED(let i): return i
+      }
+    }
+  }
+
+  public var json: String {
+    get {
+      switch self {
+      case .foreignFoo: return "\"FOREIGN_FOO\""
+      case .foreignBar: return "\"FOREIGN_BAR\""
+      case .foreignBaz: return "\"FOREIGN_BAZ\""
+      case .UNRECOGNIZED(let i): return String(i)
+      }
+    }
+  }
+
+  public var hashValue: Int { return rawValue }
+
+  public var debugDescription: String {
+    get {
+      switch self {
+      case .foreignFoo: return ".foreignFoo"
+      case .foreignBar: return ".foreignBar"
+      case .foreignBaz: return ".foreignBaz"
+      case .UNRECOGNIZED(let v): return ".UNRECOGNIZED(\(v))"
+      }
+    }
+  }
+
+}
+
+///   Represents a single test case's input.  The testee should:
+///  
+///     1. parse this proto (which should always succeed)
+///     2. parse the protobuf or JSON payload in "payload" (which may fail)
+///     3. if the parse succeeded, serialize the message in the requested format.
+public struct Conformance_ConformanceRequest: SwiftProtobuf.Message, SwiftProtobuf.Proto3Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf.ProtoNameProviding {
+  public var swiftClassName: String {return "Conformance_ConformanceRequest"}
+  public var protoMessageName: String {return "ConformanceRequest"}
+  public var protoPackageName: String {return "conformance"}
+  public static let _protobuf_fieldNames: FieldNameMap = [
+    1: .unique(proto: "protobuf_payload", json: "protobufPayload", swift: "protobufPayload"),
+    2: .unique(proto: "json_payload", json: "jsonPayload", swift: "jsonPayload"),
+    3: .unique(proto: "requested_output_format", json: "requestedOutputFormat", swift: "requestedOutputFormat"),
+  ]
+
+
+  public enum OneOf_Payload: ExpressibleByNilLiteral, SwiftProtobuf.OneofEnum {
+    case protobufPayload(Data)
+    case jsonPayload(String)
+    case None
+
+    public init(nilLiteral: ()) {
+      self = .None
+    }
+
+    public init() {
+      self = .None
+    }
+
+    public mutating func decodeField(setter: inout SwiftProtobuf.FieldDecoder, protoFieldNumber: Int) throws {
+      if self != .None && setter.rejectConflictingOneof {
+        throw SwiftProtobuf.DecodingError.duplicatedOneOf
+      }
+      switch protoFieldNumber {
+      case 1:
+        var value = Data()
+        try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufBytes.self, value: &value)
+        self = .protobufPayload(value)
+      case 2:
+        var value = String()
+        try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: &value)
+        self = .jsonPayload(value)
+      default:
+        self = .None
+      }
+    }
+
+    public func traverse(visitor: inout SwiftProtobuf.Visitor, start: Int, end: Int) throws {
+      switch self {
+      case .protobufPayload(let v):
+        if start <= 1 && 1 < end {
+          try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufBytes.self, value: v, protoFieldNumber: 1)
+        }
+      case .jsonPayload(let v):
+        if start <= 2 && 2 < end {
+          try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: v, protoFieldNumber: 2)
+        }
+      case .None:
+        break
+      }
+    }
+  }
+
+  public var protobufPayload: Data {
+    get {
+      if case .protobufPayload(let v) = payload {
+        return v
+      }
+      return Data()
+    }
+    set {
+      payload = .protobufPayload(newValue)
+    }
+  }
+
+  public var payload: Conformance_ConformanceRequest.OneOf_Payload = .None
+
+  public var jsonPayload: String {
+    get {
+      if case .jsonPayload(let v) = payload {
+        return v
+      }
+      return ""
+    }
+    set {
+      payload = .jsonPayload(newValue)
+    }
+  }
+
+  ///   Which format should the testee serialize its message to?
+  public var requestedOutputFormat: Conformance_WireFormat = Conformance_WireFormat.unspecified
+
+  public init() {}
+
+  public mutating func _protoc_generated_decodeField(setter: inout SwiftProtobuf.FieldDecoder, protoFieldNumber: Int) throws {
+    switch protoFieldNumber {
+    case 1, 2: try payload.decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+    case 3: try setter.decodeSingularField(fieldType: Conformance_WireFormat.self, value: &requestedOutputFormat)
+    default: break
+    }
+  }
+
+  public func _protoc_generated_traverse(visitor: inout SwiftProtobuf.Visitor) throws {
+    try payload.traverse(visitor: &visitor, start: 1, end: 3)
+    if requestedOutputFormat != Conformance_WireFormat.unspecified {
+      try visitor.visitSingularField(fieldType: Conformance_WireFormat.self, value: requestedOutputFormat, protoFieldNumber: 3)
+    }
+  }
+
+  public func _protoc_generated_isEqualTo(other: Conformance_ConformanceRequest) -> Bool {
+    if payload != other.payload {return false}
+    if requestedOutputFormat != other.requestedOutputFormat {return false}
+    return true
+  }
+}
+
+///   Represents a single test case's output.
+public struct Conformance_ConformanceResponse: SwiftProtobuf.Message, SwiftProtobuf.Proto3Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf.ProtoNameProviding {
+  public var swiftClassName: String {return "Conformance_ConformanceResponse"}
+  public var protoMessageName: String {return "ConformanceResponse"}
+  public var protoPackageName: String {return "conformance"}
+  public static let _protobuf_fieldNames: FieldNameMap = [
+    1: .unique(proto: "parse_error", json: "parseError", swift: "parseError"),
+    6: .unique(proto: "serialize_error", json: "serializeError", swift: "serializeError"),
+    2: .unique(proto: "runtime_error", json: "runtimeError", swift: "runtimeError"),
+    3: .unique(proto: "protobuf_payload", json: "protobufPayload", swift: "protobufPayload"),
+    4: .unique(proto: "json_payload", json: "jsonPayload", swift: "jsonPayload"),
+    5: .same(proto: "skipped", swift: "skipped"),
+  ]
+
+
+  public enum OneOf_Result: ExpressibleByNilLiteral, SwiftProtobuf.OneofEnum {
+    case parseError(String)
+    case serializeError(String)
+    case runtimeError(String)
+    case protobufPayload(Data)
+    case jsonPayload(String)
+    case skipped(String)
+    case None
+
+    public init(nilLiteral: ()) {
+      self = .None
+    }
+
+    public init() {
+      self = .None
+    }
+
+    public mutating func decodeField(setter: inout SwiftProtobuf.FieldDecoder, protoFieldNumber: Int) throws {
+      if self != .None && setter.rejectConflictingOneof {
+        throw SwiftProtobuf.DecodingError.duplicatedOneOf
+      }
+      switch protoFieldNumber {
+      case 1:
+        var value = String()
+        try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: &value)
+        self = .parseError(value)
+      case 2:
+        var value = String()
+        try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: &value)
+        self = .runtimeError(value)
+      case 3:
+        var value = Data()
+        try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufBytes.self, value: &value)
+        self = .protobufPayload(value)
+      case 4:
+        var value = String()
+        try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: &value)
+        self = .jsonPayload(value)
+      case 5:
+        var value = String()
+        try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: &value)
+        self = .skipped(value)
+      case 6:
+        var value = String()
+        try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: &value)
+        self = .serializeError(value)
+      default:
+        self = .None
+      }
+    }
+
+    public func traverse(visitor: inout SwiftProtobuf.Visitor, start: Int, end: Int) throws {
+      switch self {
+      case .parseError(let v):
+        if start <= 1 && 1 < end {
+          try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: v, protoFieldNumber: 1)
+        }
+      case .runtimeError(let v):
+        if start <= 2 && 2 < end {
+          try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: v, protoFieldNumber: 2)
+        }
+      case .protobufPayload(let v):
+        if start <= 3 && 3 < end {
+          try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufBytes.self, value: v, protoFieldNumber: 3)
+        }
+      case .jsonPayload(let v):
+        if start <= 4 && 4 < end {
+          try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: v, protoFieldNumber: 4)
+        }
+      case .skipped(let v):
+        if start <= 5 && 5 < end {
+          try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: v, protoFieldNumber: 5)
+        }
+      case .serializeError(let v):
+        if start <= 6 && 6 < end {
+          try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: v, protoFieldNumber: 6)
+        }
+      case .None:
+        break
+      }
+    }
+  }
+
+  ///   This string should be set to indicate parsing failed.  The string can
+  ///   provide more information about the parse error if it is available.
+  ///  
+  ///   Setting this string does not necessarily mean the testee failed the
+  ///   test.  Some of the test cases are intentionally invalid input.
+  public var parseError: String {
+    get {
+      if case .parseError(let v) = result {
+        return v
+      }
+      return ""
+    }
+    set {
+      result = .parseError(newValue)
+    }
+  }
+
+  public var result: Conformance_ConformanceResponse.OneOf_Result = .None
+
+  ///   If the input was successfully parsed but errors occurred when
+  ///   serializing it to the requested output format, set the error message in
+  ///   this field.
+  public var serializeError: String {
+    get {
+      if case .serializeError(let v) = result {
+        return v
+      }
+      return ""
+    }
+    set {
+      result = .serializeError(newValue)
+    }
+  }
+
+  ///   This should be set if some other error occurred.  This will always
+  ///   indicate that the test failed.  The string can provide more information
+  ///   about the failure.
+  public var runtimeError: String {
+    get {
+      if case .runtimeError(let v) = result {
+        return v
+      }
+      return ""
+    }
+    set {
+      result = .runtimeError(newValue)
+    }
+  }
+
+  ///   If the input was successfully parsed and the requested output was
+  ///   protobuf, serialize it to protobuf and set it in this field.
+  public var protobufPayload: Data {
+    get {
+      if case .protobufPayload(let v) = result {
+        return v
+      }
+      return Data()
+    }
+    set {
+      result = .protobufPayload(newValue)
+    }
+  }
+
+  ///   If the input was successfully parsed and the requested output was JSON,
+  ///   serialize to JSON and set it in this field.
+  public var jsonPayload: String {
+    get {
+      if case .jsonPayload(let v) = result {
+        return v
+      }
+      return ""
+    }
+    set {
+      result = .jsonPayload(newValue)
+    }
+  }
+
+  ///   For when the testee skipped the test, likely because a certain feature
+  ///   wasn't supported, like JSON input/output.
+  public var skipped: String {
+    get {
+      if case .skipped(let v) = result {
+        return v
+      }
+      return ""
+    }
+    set {
+      result = .skipped(newValue)
+    }
+  }
+
+  public init() {}
+
+  public mutating func _protoc_generated_decodeField(setter: inout SwiftProtobuf.FieldDecoder, protoFieldNumber: Int) throws {
+    switch protoFieldNumber {
+    case 1, 6, 2, 3, 4, 5: try result.decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+    default: break
+    }
+  }
+
+  public func _protoc_generated_traverse(visitor: inout SwiftProtobuf.Visitor) throws {
+    try result.traverse(visitor: &visitor, start: 1, end: 7)
+  }
+
+  public func _protoc_generated_isEqualTo(other: Conformance_ConformanceResponse) -> Bool {
+    if result != other.result {return false}
+    return true
+  }
+}
+
+///   This proto includes every type of field in both singular and repeated
+///   forms.
+public struct Conformance_TestAllTypes: SwiftProtobuf.Message, SwiftProtobuf.Proto3Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf.ProtoNameProviding {
+  public var swiftClassName: String {return "Conformance_TestAllTypes"}
+  public var protoMessageName: String {return "TestAllTypes"}
+  public var protoPackageName: String {return "conformance"}
+  public static let _protobuf_fieldNames: FieldNameMap = [
+    1: .unique(proto: "optional_int32", json: "optionalInt32", swift: "optionalInt32"),
+    2: .unique(proto: "optional_int64", json: "optionalInt64", swift: "optionalInt64"),
+    3: .unique(proto: "optional_uint32", json: "optionalUint32", swift: "optionalUint32"),
+    4: .unique(proto: "optional_uint64", json: "optionalUint64", swift: "optionalUint64"),
+    5: .unique(proto: "optional_sint32", json: "optionalSint32", swift: "optionalSint32"),
+    6: .unique(proto: "optional_sint64", json: "optionalSint64", swift: "optionalSint64"),
+    7: .unique(proto: "optional_fixed32", json: "optionalFixed32", swift: "optionalFixed32"),
+    8: .unique(proto: "optional_fixed64", json: "optionalFixed64", swift: "optionalFixed64"),
+    9: .unique(proto: "optional_sfixed32", json: "optionalSfixed32", swift: "optionalSfixed32"),
+    10: .unique(proto: "optional_sfixed64", json: "optionalSfixed64", swift: "optionalSfixed64"),
+    11: .unique(proto: "optional_float", json: "optionalFloat", swift: "optionalFloat"),
+    12: .unique(proto: "optional_double", json: "optionalDouble", swift: "optionalDouble"),
+    13: .unique(proto: "optional_bool", json: "optionalBool", swift: "optionalBool"),
+    14: .unique(proto: "optional_string", json: "optionalString", swift: "optionalString"),
+    15: .unique(proto: "optional_bytes", json: "optionalBytes", swift: "optionalBytes"),
+    18: .unique(proto: "optional_nested_message", json: "optionalNestedMessage", swift: "optionalNestedMessage"),
+    19: .unique(proto: "optional_foreign_message", json: "optionalForeignMessage", swift: "optionalForeignMessage"),
+    21: .unique(proto: "optional_nested_enum", json: "optionalNestedEnum", swift: "optionalNestedEnum"),
+    22: .unique(proto: "optional_foreign_enum", json: "optionalForeignEnum", swift: "optionalForeignEnum"),
+    24: .unique(proto: "optional_string_piece", json: "optionalStringPiece", swift: "optionalStringPiece"),
+    25: .unique(proto: "optional_cord", json: "optionalCord", swift: "optionalCord"),
+    27: .unique(proto: "recursive_message", json: "recursiveMessage", swift: "recursiveMessage"),
+    31: .unique(proto: "repeated_int32", json: "repeatedInt32", swift: "repeatedInt32"),
+    32: .unique(proto: "repeated_int64", json: "repeatedInt64", swift: "repeatedInt64"),
+    33: .unique(proto: "repeated_uint32", json: "repeatedUint32", swift: "repeatedUint32"),
+    34: .unique(proto: "repeated_uint64", json: "repeatedUint64", swift: "repeatedUint64"),
+    35: .unique(proto: "repeated_sint32", json: "repeatedSint32", swift: "repeatedSint32"),
+    36: .unique(proto: "repeated_sint64", json: "repeatedSint64", swift: "repeatedSint64"),
+    37: .unique(proto: "repeated_fixed32", json: "repeatedFixed32", swift: "repeatedFixed32"),
+    38: .unique(proto: "repeated_fixed64", json: "repeatedFixed64", swift: "repeatedFixed64"),
+    39: .unique(proto: "repeated_sfixed32", json: "repeatedSfixed32", swift: "repeatedSfixed32"),
+    40: .unique(proto: "repeated_sfixed64", json: "repeatedSfixed64", swift: "repeatedSfixed64"),
+    41: .unique(proto: "repeated_float", json: "repeatedFloat", swift: "repeatedFloat"),
+    42: .unique(proto: "repeated_double", json: "repeatedDouble", swift: "repeatedDouble"),
+    43: .unique(proto: "repeated_bool", json: "repeatedBool", swift: "repeatedBool"),
+    44: .unique(proto: "repeated_string", json: "repeatedString", swift: "repeatedString"),
+    45: .unique(proto: "repeated_bytes", json: "repeatedBytes", swift: "repeatedBytes"),
+    48: .unique(proto: "repeated_nested_message", json: "repeatedNestedMessage", swift: "repeatedNestedMessage"),
+    49: .unique(proto: "repeated_foreign_message", json: "repeatedForeignMessage", swift: "repeatedForeignMessage"),
+    51: .unique(proto: "repeated_nested_enum", json: "repeatedNestedEnum", swift: "repeatedNestedEnum"),
+    52: .unique(proto: "repeated_foreign_enum", json: "repeatedForeignEnum", swift: "repeatedForeignEnum"),
+    54: .unique(proto: "repeated_string_piece", json: "repeatedStringPiece", swift: "repeatedStringPiece"),
+    55: .unique(proto: "repeated_cord", json: "repeatedCord", swift: "repeatedCord"),
+    56: .unique(proto: "map_int32_int32", json: "mapInt32Int32", swift: "mapInt32Int32"),
+    57: .unique(proto: "map_int64_int64", json: "mapInt64Int64", swift: "mapInt64Int64"),
+    58: .unique(proto: "map_uint32_uint32", json: "mapUint32Uint32", swift: "mapUint32Uint32"),
+    59: .unique(proto: "map_uint64_uint64", json: "mapUint64Uint64", swift: "mapUint64Uint64"),
+    60: .unique(proto: "map_sint32_sint32", json: "mapSint32Sint32", swift: "mapSint32Sint32"),
+    61: .unique(proto: "map_sint64_sint64", json: "mapSint64Sint64", swift: "mapSint64Sint64"),
+    62: .unique(proto: "map_fixed32_fixed32", json: "mapFixed32Fixed32", swift: "mapFixed32Fixed32"),
+    63: .unique(proto: "map_fixed64_fixed64", json: "mapFixed64Fixed64", swift: "mapFixed64Fixed64"),
+    64: .unique(proto: "map_sfixed32_sfixed32", json: "mapSfixed32Sfixed32", swift: "mapSfixed32Sfixed32"),
+    65: .unique(proto: "map_sfixed64_sfixed64", json: "mapSfixed64Sfixed64", swift: "mapSfixed64Sfixed64"),
+    66: .unique(proto: "map_int32_float", json: "mapInt32Float", swift: "mapInt32Float"),
+    67: .unique(proto: "map_int32_double", json: "mapInt32Double", swift: "mapInt32Double"),
+    68: .unique(proto: "map_bool_bool", json: "mapBoolBool", swift: "mapBoolBool"),
+    69: .unique(proto: "map_string_string", json: "mapStringString", swift: "mapStringString"),
+    70: .unique(proto: "map_string_bytes", json: "mapStringBytes", swift: "mapStringBytes"),
+    71: .unique(proto: "map_string_nested_message", json: "mapStringNestedMessage", swift: "mapStringNestedMessage"),
+    72: .unique(proto: "map_string_foreign_message", json: "mapStringForeignMessage", swift: "mapStringForeignMessage"),
+    73: .unique(proto: "map_string_nested_enum", json: "mapStringNestedEnum", swift: "mapStringNestedEnum"),
+    74: .unique(proto: "map_string_foreign_enum", json: "mapStringForeignEnum", swift: "mapStringForeignEnum"),
+    111: .unique(proto: "oneof_uint32", json: "oneofUint32", swift: "oneofUint32"),
+    112: .unique(proto: "oneof_nested_message", json: "oneofNestedMessage", swift: "oneofNestedMessage"),
+    113: .unique(proto: "oneof_string", json: "oneofString", swift: "oneofString"),
+    114: .unique(proto: "oneof_bytes", json: "oneofBytes", swift: "oneofBytes"),
+    115: .unique(proto: "oneof_bool", json: "oneofBool", swift: "oneofBool"),
+    116: .unique(proto: "oneof_uint64", json: "oneofUint64", swift: "oneofUint64"),
+    117: .unique(proto: "oneof_float", json: "oneofFloat", swift: "oneofFloat"),
+    118: .unique(proto: "oneof_double", json: "oneofDouble", swift: "oneofDouble"),
+    119: .unique(proto: "oneof_enum", json: "oneofEnum", swift: "oneofEnum"),
+    201: .unique(proto: "optional_bool_wrapper", json: "optionalBoolWrapper", swift: "optionalBoolWrapper"),
+    202: .unique(proto: "optional_int32_wrapper", json: "optionalInt32Wrapper", swift: "optionalInt32Wrapper"),
+    203: .unique(proto: "optional_int64_wrapper", json: "optionalInt64Wrapper", swift: "optionalInt64Wrapper"),
+    204: .unique(proto: "optional_uint32_wrapper", json: "optionalUint32Wrapper", swift: "optionalUint32Wrapper"),
+    205: .unique(proto: "optional_uint64_wrapper", json: "optionalUint64Wrapper", swift: "optionalUint64Wrapper"),
+    206: .unique(proto: "optional_float_wrapper", json: "optionalFloatWrapper", swift: "optionalFloatWrapper"),
+    207: .unique(proto: "optional_double_wrapper", json: "optionalDoubleWrapper", swift: "optionalDoubleWrapper"),
+    208: .unique(proto: "optional_string_wrapper", json: "optionalStringWrapper", swift: "optionalStringWrapper"),
+    209: .unique(proto: "optional_bytes_wrapper", json: "optionalBytesWrapper", swift: "optionalBytesWrapper"),
+    211: .unique(proto: "repeated_bool_wrapper", json: "repeatedBoolWrapper", swift: "repeatedBoolWrapper"),
+    212: .unique(proto: "repeated_int32_wrapper", json: "repeatedInt32Wrapper", swift: "repeatedInt32Wrapper"),
+    213: .unique(proto: "repeated_int64_wrapper", json: "repeatedInt64Wrapper", swift: "repeatedInt64Wrapper"),
+    214: .unique(proto: "repeated_uint32_wrapper", json: "repeatedUint32Wrapper", swift: "repeatedUint32Wrapper"),
+    215: .unique(proto: "repeated_uint64_wrapper", json: "repeatedUint64Wrapper", swift: "repeatedUint64Wrapper"),
+    216: .unique(proto: "repeated_float_wrapper", json: "repeatedFloatWrapper", swift: "repeatedFloatWrapper"),
+    217: .unique(proto: "repeated_double_wrapper", json: "repeatedDoubleWrapper", swift: "repeatedDoubleWrapper"),
+    218: .unique(proto: "repeated_string_wrapper", json: "repeatedStringWrapper", swift: "repeatedStringWrapper"),
+    219: .unique(proto: "repeated_bytes_wrapper", json: "repeatedBytesWrapper", swift: "repeatedBytesWrapper"),
+    301: .unique(proto: "optional_duration", json: "optionalDuration", swift: "optionalDuration"),
+    302: .unique(proto: "optional_timestamp", json: "optionalTimestamp", swift: "optionalTimestamp"),
+    303: .unique(proto: "optional_field_mask", json: "optionalFieldMask", swift: "optionalFieldMask"),
+    304: .unique(proto: "optional_struct", json: "optionalStruct", swift: "optionalStruct"),
+    305: .unique(proto: "optional_any", json: "optionalAny", swift: "optionalAny"),
+    306: .unique(proto: "optional_value", json: "optionalValue", swift: "optionalValue"),
+    311: .unique(proto: "repeated_duration", json: "repeatedDuration", swift: "repeatedDuration"),
+    312: .unique(proto: "repeated_timestamp", json: "repeatedTimestamp", swift: "repeatedTimestamp"),
+    313: .unique(proto: "repeated_fieldmask", json: "repeatedFieldmask", swift: "repeatedFieldmask"),
+    324: .unique(proto: "repeated_struct", json: "repeatedStruct", swift: "repeatedStruct"),
+    315: .unique(proto: "repeated_any", json: "repeatedAny", swift: "repeatedAny"),
+    316: .unique(proto: "repeated_value", json: "repeatedValue", swift: "repeatedValue"),
+    401: .same(proto: "fieldname1", swift: "fieldname1"),
+    402: .unique(proto: "field_name2", json: "fieldName2", swift: "fieldName2"),
+    403: .unique(proto: "_field_name3", json: "FieldName3", swift: "fieldName3"),
+    404: .unique(proto: "field__name4_", json: "fieldName4", swift: "field_Name4_"),
+    405: .same(proto: "field0name5", swift: "field0Name5"),
+    406: .unique(proto: "field_0_name6", json: "field0Name6", swift: "field0Name6"),
+    407: .same(proto: "fieldName7", swift: "fieldName7"),
+    408: .same(proto: "FieldName8", swift: "fieldName8"),
+    409: .unique(proto: "field_Name9", json: "fieldName9", swift: "fieldName9"),
+    410: .unique(proto: "Field_Name10", json: "FieldName10", swift: "fieldName10"),
+    411: .unique(proto: "FIELD_NAME11", json: "FIELDNAME11", swift: "fieldName11"),
+    412: .unique(proto: "FIELD_name12", json: "FIELDName12", swift: "fieldName12"),
+    413: .unique(proto: "__field_name13", json: "FieldName13", swift: "_FieldName13"),
+    414: .unique(proto: "__Field_name14", json: "FieldName14", swift: "_FieldName14"),
+    415: .unique(proto: "field__name15", json: "fieldName15", swift: "field_Name15"),
+    416: .unique(proto: "field__Name16", json: "fieldName16", swift: "field_Name16"),
+    417: .unique(proto: "field_name17__", json: "fieldName17", swift: "fieldName17__"),
+    418: .unique(proto: "Field_name18__", json: "FieldName18", swift: "fieldName18__"),
+  ]
+
+  private class _StorageClass {
+    typealias ExtendedMessage = Conformance_TestAllTypes
+    var _optionalInt32: Int32 = 0
+    var _optionalInt64: Int64 = 0
+    var _optionalUint32: UInt32 = 0
+    var _optionalUint64: UInt64 = 0
+    var _optionalSint32: Int32 = 0
+    var _optionalSint64: Int64 = 0
+    var _optionalFixed32: UInt32 = 0
+    var _optionalFixed64: UInt64 = 0
+    var _optionalSfixed32: Int32 = 0
+    var _optionalSfixed64: Int64 = 0
+    var _optionalFloat: Float = 0
+    var _optionalDouble: Double = 0
+    var _optionalBool: Bool = false
+    var _optionalString: String = ""
+    var _optionalBytes: Data = Data()
+    var _optionalNestedMessage: Conformance_TestAllTypes.NestedMessage? = nil
+    var _optionalForeignMessage: Conformance_ForeignMessage? = nil
+    var _optionalNestedEnum: Conformance_TestAllTypes.NestedEnum = Conformance_TestAllTypes.NestedEnum.foo
+    var _optionalForeignEnum: Conformance_ForeignEnum = Conformance_ForeignEnum.foreignFoo
+    var _optionalStringPiece: String = ""
+    var _optionalCord: String = ""
+    var _recursiveMessage: Conformance_TestAllTypes? = nil
+    var _repeatedInt32: [Int32] = []
+    var _repeatedInt64: [Int64] = []
+    var _repeatedUint32: [UInt32] = []
+    var _repeatedUint64: [UInt64] = []
+    var _repeatedSint32: [Int32] = []
+    var _repeatedSint64: [Int64] = []
+    var _repeatedFixed32: [UInt32] = []
+    var _repeatedFixed64: [UInt64] = []
+    var _repeatedSfixed32: [Int32] = []
+    var _repeatedSfixed64: [Int64] = []
+    var _repeatedFloat: [Float] = []
+    var _repeatedDouble: [Double] = []
+    var _repeatedBool: [Bool] = []
+    var _repeatedString: [String] = []
+    var _repeatedBytes: [Data] = []
+    var _repeatedNestedMessage: [Conformance_TestAllTypes.NestedMessage] = []
+    var _repeatedForeignMessage: [Conformance_ForeignMessage] = []
+    var _repeatedNestedEnum: [Conformance_TestAllTypes.NestedEnum] = []
+    var _repeatedForeignEnum: [Conformance_ForeignEnum] = []
+    var _repeatedStringPiece: [String] = []
+    var _repeatedCord: [String] = []
+    var _mapInt32Int32: Dictionary<Int32,Int32> = [:]
+    var _mapInt64Int64: Dictionary<Int64,Int64> = [:]
+    var _mapUint32Uint32: Dictionary<UInt32,UInt32> = [:]
+    var _mapUint64Uint64: Dictionary<UInt64,UInt64> = [:]
+    var _mapSint32Sint32: Dictionary<Int32,Int32> = [:]
+    var _mapSint64Sint64: Dictionary<Int64,Int64> = [:]
+    var _mapFixed32Fixed32: Dictionary<UInt32,UInt32> = [:]
+    var _mapFixed64Fixed64: Dictionary<UInt64,UInt64> = [:]
+    var _mapSfixed32Sfixed32: Dictionary<Int32,Int32> = [:]
+    var _mapSfixed64Sfixed64: Dictionary<Int64,Int64> = [:]
+    var _mapInt32Float: Dictionary<Int32,Float> = [:]
+    var _mapInt32Double: Dictionary<Int32,Double> = [:]
+    var _mapBoolBool: Dictionary<Bool,Bool> = [:]
+    var _mapStringString: Dictionary<String,String> = [:]
+    var _mapStringBytes: Dictionary<String,Data> = [:]
+    var _mapStringNestedMessage: Dictionary<String,Conformance_TestAllTypes.NestedMessage> = [:]
+    var _mapStringForeignMessage: Dictionary<String,Conformance_ForeignMessage> = [:]
+    var _mapStringNestedEnum: Dictionary<String,Conformance_TestAllTypes.NestedEnum> = [:]
+    var _mapStringForeignEnum: Dictionary<String,Conformance_ForeignEnum> = [:]
+    var _oneofField = Conformance_TestAllTypes.OneOf_OneofField()
+    var _optionalBoolWrapper: Google_Protobuf_BoolValue? = nil
+    var _optionalInt32Wrapper: Google_Protobuf_Int32Value? = nil
+    var _optionalInt64Wrapper: Google_Protobuf_Int64Value? = nil
+    var _optionalUint32Wrapper: Google_Protobuf_UInt32Value? = nil
+    var _optionalUint64Wrapper: Google_Protobuf_UInt64Value? = nil
+    var _optionalFloatWrapper: Google_Protobuf_FloatValue? = nil
+    var _optionalDoubleWrapper: Google_Protobuf_DoubleValue? = nil
+    var _optionalStringWrapper: Google_Protobuf_StringValue? = nil
+    var _optionalBytesWrapper: Google_Protobuf_BytesValue? = nil
+    var _repeatedBoolWrapper: [Google_Protobuf_BoolValue] = []
+    var _repeatedInt32Wrapper: [Google_Protobuf_Int32Value] = []
+    var _repeatedInt64Wrapper: [Google_Protobuf_Int64Value] = []
+    var _repeatedUint32Wrapper: [Google_Protobuf_UInt32Value] = []
+    var _repeatedUint64Wrapper: [Google_Protobuf_UInt64Value] = []
+    var _repeatedFloatWrapper: [Google_Protobuf_FloatValue] = []
+    var _repeatedDoubleWrapper: [Google_Protobuf_DoubleValue] = []
+    var _repeatedStringWrapper: [Google_Protobuf_StringValue] = []
+    var _repeatedBytesWrapper: [Google_Protobuf_BytesValue] = []
+    var _optionalDuration: Google_Protobuf_Duration? = nil
+    var _optionalTimestamp: Google_Protobuf_Timestamp? = nil
+    var _optionalFieldMask: Google_Protobuf_FieldMask? = nil
+    var _optionalStruct: Google_Protobuf_Struct? = nil
+    var _optionalAny: Google_Protobuf_Any? = nil
+    var _optionalValue: Google_Protobuf_Value? = nil
+    var _repeatedDuration: [Google_Protobuf_Duration] = []
+    var _repeatedTimestamp: [Google_Protobuf_Timestamp] = []
+    var _repeatedFieldmask: [Google_Protobuf_FieldMask] = []
+    var _repeatedStruct: [Google_Protobuf_Struct] = []
+    var _repeatedAny: [Google_Protobuf_Any] = []
+    var _repeatedValue: [Google_Protobuf_Value] = []
+    var _fieldname1: Int32 = 0
+    var _fieldName2: Int32 = 0
+    var _fieldName3: Int32 = 0
+    var _field_Name4_: Int32 = 0
+    var _field0Name5: Int32 = 0
+    var _field0Name6: Int32 = 0
+    var _fieldName7: Int32 = 0
+    var _fieldName8: Int32 = 0
+    var _fieldName9: Int32 = 0
+    var _fieldName10: Int32 = 0
+    var _fieldName11: Int32 = 0
+    var _fieldName12: Int32 = 0
+    var __FieldName13: Int32 = 0
+    var __FieldName14: Int32 = 0
+    var _field_Name15: Int32 = 0
+    var _field_Name16: Int32 = 0
+    var _fieldName17__: Int32 = 0
+    var _fieldName18__: Int32 = 0
+
+    init() {}
+
+    func decodeField(setter: inout SwiftProtobuf.FieldDecoder, protoFieldNumber: Int) throws {
+      switch protoFieldNumber {
+      case 1: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_optionalInt32)
+      case 2: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt64.self, value: &_optionalInt64)
+      case 3: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufUInt32.self, value: &_optionalUint32)
+      case 4: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufUInt64.self, value: &_optionalUint64)
+      case 5: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufSInt32.self, value: &_optionalSint32)
+      case 6: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufSInt64.self, value: &_optionalSint64)
+      case 7: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufFixed32.self, value: &_optionalFixed32)
+      case 8: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufFixed64.self, value: &_optionalFixed64)
+      case 9: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufSFixed32.self, value: &_optionalSfixed32)
+      case 10: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufSFixed64.self, value: &_optionalSfixed64)
+      case 11: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufFloat.self, value: &_optionalFloat)
+      case 12: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufDouble.self, value: &_optionalDouble)
+      case 13: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufBool.self, value: &_optionalBool)
+      case 14: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: &_optionalString)
+      case 15: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufBytes.self, value: &_optionalBytes)
+      case 18: try setter.decodeSingularMessageField(fieldType: Conformance_TestAllTypes.NestedMessage.self, value: &_optionalNestedMessage)
+      case 19: try setter.decodeSingularMessageField(fieldType: Conformance_ForeignMessage.self, value: &_optionalForeignMessage)
+      case 21: try setter.decodeSingularField(fieldType: Conformance_TestAllTypes.NestedEnum.self, value: &_optionalNestedEnum)
+      case 22: try setter.decodeSingularField(fieldType: Conformance_ForeignEnum.self, value: &_optionalForeignEnum)
+      case 24: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: &_optionalStringPiece)
+      case 25: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: &_optionalCord)
+      case 27: try setter.decodeSingularMessageField(fieldType: Conformance_TestAllTypes.self, value: &_recursiveMessage)
+      case 31: try setter.decodePackedField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_repeatedInt32)
+      case 32: try setter.decodePackedField(fieldType: SwiftProtobuf.ProtobufInt64.self, value: &_repeatedInt64)
+      case 33: try setter.decodePackedField(fieldType: SwiftProtobuf.ProtobufUInt32.self, value: &_repeatedUint32)
+      case 34: try setter.decodePackedField(fieldType: SwiftProtobuf.ProtobufUInt64.self, value: &_repeatedUint64)
+      case 35: try setter.decodePackedField(fieldType: SwiftProtobuf.ProtobufSInt32.self, value: &_repeatedSint32)
+      case 36: try setter.decodePackedField(fieldType: SwiftProtobuf.ProtobufSInt64.self, value: &_repeatedSint64)
+      case 37: try setter.decodePackedField(fieldType: SwiftProtobuf.ProtobufFixed32.self, value: &_repeatedFixed32)
+      case 38: try setter.decodePackedField(fieldType: SwiftProtobuf.ProtobufFixed64.self, value: &_repeatedFixed64)
+      case 39: try setter.decodePackedField(fieldType: SwiftProtobuf.ProtobufSFixed32.self, value: &_repeatedSfixed32)
+      case 40: try setter.decodePackedField(fieldType: SwiftProtobuf.ProtobufSFixed64.self, value: &_repeatedSfixed64)
+      case 41: try setter.decodePackedField(fieldType: SwiftProtobuf.ProtobufFloat.self, value: &_repeatedFloat)
+      case 42: try setter.decodePackedField(fieldType: SwiftProtobuf.ProtobufDouble.self, value: &_repeatedDouble)
+      case 43: try setter.decodePackedField(fieldType: SwiftProtobuf.ProtobufBool.self, value: &_repeatedBool)
+      case 44: try setter.decodeRepeatedField(fieldType: SwiftProtobuf.ProtobufString.self, value: &_repeatedString)
+      case 45: try setter.decodeRepeatedField(fieldType: SwiftProtobuf.ProtobufBytes.self, value: &_repeatedBytes)
+      case 48: try setter.decodeRepeatedMessageField(fieldType: Conformance_TestAllTypes.NestedMessage.self, value: &_repeatedNestedMessage)
+      case 49: try setter.decodeRepeatedMessageField(fieldType: Conformance_ForeignMessage.self, value: &_repeatedForeignMessage)
+      case 51: try setter.decodePackedField(fieldType: Conformance_TestAllTypes.NestedEnum.self, value: &_repeatedNestedEnum)
+      case 52: try setter.decodePackedField(fieldType: Conformance_ForeignEnum.self, value: &_repeatedForeignEnum)
+      case 54: try setter.decodeRepeatedField(fieldType: SwiftProtobuf.ProtobufString.self, value: &_repeatedStringPiece)
+      case 55: try setter.decodeRepeatedField(fieldType: SwiftProtobuf.ProtobufString.self, value: &_repeatedCord)
+      case 56: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: &_mapInt32Int32)
+      case 57: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufInt64,SwiftProtobuf.ProtobufInt64>.self, value: &_mapInt64Int64)
+      case 58: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufUInt32,SwiftProtobuf.ProtobufUInt32>.self, value: &_mapUint32Uint32)
+      case 59: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufUInt64,SwiftProtobuf.ProtobufUInt64>.self, value: &_mapUint64Uint64)
+      case 60: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufSInt32,SwiftProtobuf.ProtobufSInt32>.self, value: &_mapSint32Sint32)
+      case 61: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufSInt64,SwiftProtobuf.ProtobufSInt64>.self, value: &_mapSint64Sint64)
+      case 62: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufFixed32,SwiftProtobuf.ProtobufFixed32>.self, value: &_mapFixed32Fixed32)
+      case 63: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufFixed64,SwiftProtobuf.ProtobufFixed64>.self, value: &_mapFixed64Fixed64)
+      case 64: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufSFixed32,SwiftProtobuf.ProtobufSFixed32>.self, value: &_mapSfixed32Sfixed32)
+      case 65: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufSFixed64,SwiftProtobuf.ProtobufSFixed64>.self, value: &_mapSfixed64Sfixed64)
+      case 66: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufFloat>.self, value: &_mapInt32Float)
+      case 67: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufDouble>.self, value: &_mapInt32Double)
+      case 68: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufBool,SwiftProtobuf.ProtobufBool>.self, value: &_mapBoolBool)
+      case 69: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &_mapStringString)
+      case 70: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufBytes>.self, value: &_mapStringBytes)
+      case 71: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufString,Conformance_TestAllTypes.NestedMessage>.self, value: &_mapStringNestedMessage)
+      case 72: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufString,Conformance_ForeignMessage>.self, value: &_mapStringForeignMessage)
+      case 73: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufString,Conformance_TestAllTypes.NestedEnum>.self, value: &_mapStringNestedEnum)
+      case 74: try setter.decodeMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufString,Conformance_ForeignEnum>.self, value: &_mapStringForeignEnum)
+      case 111, 112, 113, 114, 115, 116, 117, 118, 119: try _oneofField.decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+      case 201: try setter.decodeSingularMessageField(fieldType: Google_Protobuf_BoolValue.self, value: &_optionalBoolWrapper)
+      case 202: try setter.decodeSingularMessageField(fieldType: Google_Protobuf_Int32Value.self, value: &_optionalInt32Wrapper)
+      case 203: try setter.decodeSingularMessageField(fieldType: Google_Protobuf_Int64Value.self, value: &_optionalInt64Wrapper)
+      case 204: try setter.decodeSingularMessageField(fieldType: Google_Protobuf_UInt32Value.self, value: &_optionalUint32Wrapper)
+      case 205: try setter.decodeSingularMessageField(fieldType: Google_Protobuf_UInt64Value.self, value: &_optionalUint64Wrapper)
+      case 206: try setter.decodeSingularMessageField(fieldType: Google_Protobuf_FloatValue.self, value: &_optionalFloatWrapper)
+      case 207: try setter.decodeSingularMessageField(fieldType: Google_Protobuf_DoubleValue.self, value: &_optionalDoubleWrapper)
+      case 208: try setter.decodeSingularMessageField(fieldType: Google_Protobuf_StringValue.self, value: &_optionalStringWrapper)
+      case 209: try setter.decodeSingularMessageField(fieldType: Google_Protobuf_BytesValue.self, value: &_optionalBytesWrapper)
+      case 211: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_BoolValue.self, value: &_repeatedBoolWrapper)
+      case 212: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_Int32Value.self, value: &_repeatedInt32Wrapper)
+      case 213: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_Int64Value.self, value: &_repeatedInt64Wrapper)
+      case 214: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_UInt32Value.self, value: &_repeatedUint32Wrapper)
+      case 215: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_UInt64Value.self, value: &_repeatedUint64Wrapper)
+      case 216: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_FloatValue.self, value: &_repeatedFloatWrapper)
+      case 217: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_DoubleValue.self, value: &_repeatedDoubleWrapper)
+      case 218: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_StringValue.self, value: &_repeatedStringWrapper)
+      case 219: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_BytesValue.self, value: &_repeatedBytesWrapper)
+      case 301: try setter.decodeSingularMessageField(fieldType: Google_Protobuf_Duration.self, value: &_optionalDuration)
+      case 302: try setter.decodeSingularMessageField(fieldType: Google_Protobuf_Timestamp.self, value: &_optionalTimestamp)
+      case 303: try setter.decodeSingularMessageField(fieldType: Google_Protobuf_FieldMask.self, value: &_optionalFieldMask)
+      case 304: try setter.decodeSingularMessageField(fieldType: Google_Protobuf_Struct.self, value: &_optionalStruct)
+      case 305: try setter.decodeSingularMessageField(fieldType: Google_Protobuf_Any.self, value: &_optionalAny)
+      case 306: try setter.decodeSingularMessageField(fieldType: Google_Protobuf_Value.self, value: &_optionalValue)
+      case 311: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_Duration.self, value: &_repeatedDuration)
+      case 312: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_Timestamp.self, value: &_repeatedTimestamp)
+      case 313: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_FieldMask.self, value: &_repeatedFieldmask)
+      case 324: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_Struct.self, value: &_repeatedStruct)
+      case 315: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_Any.self, value: &_repeatedAny)
+      case 316: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_Value.self, value: &_repeatedValue)
+      case 401: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_fieldname1)
+      case 402: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_fieldName2)
+      case 403: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_fieldName3)
+      case 404: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_field_Name4_)
+      case 405: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_field0Name5)
+      case 406: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_field0Name6)
+      case 407: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_fieldName7)
+      case 408: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_fieldName8)
+      case 409: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_fieldName9)
+      case 410: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_fieldName10)
+      case 411: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_fieldName11)
+      case 412: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_fieldName12)
+      case 413: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &__FieldName13)
+      case 414: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &__FieldName14)
+      case 415: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_field_Name15)
+      case 416: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_field_Name16)
+      case 417: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_fieldName17__)
+      case 418: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_fieldName18__)
+      default: break
+      }
+    }
+
+    func traverse(visitor: inout SwiftProtobuf.Visitor) throws {
+      if _optionalInt32 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _optionalInt32, protoFieldNumber: 1)
+      }
+      if _optionalInt64 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt64.self, value: _optionalInt64, protoFieldNumber: 2)
+      }
+      if _optionalUint32 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufUInt32.self, value: _optionalUint32, protoFieldNumber: 3)
+      }
+      if _optionalUint64 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufUInt64.self, value: _optionalUint64, protoFieldNumber: 4)
+      }
+      if _optionalSint32 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufSInt32.self, value: _optionalSint32, protoFieldNumber: 5)
+      }
+      if _optionalSint64 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufSInt64.self, value: _optionalSint64, protoFieldNumber: 6)
+      }
+      if _optionalFixed32 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufFixed32.self, value: _optionalFixed32, protoFieldNumber: 7)
+      }
+      if _optionalFixed64 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufFixed64.self, value: _optionalFixed64, protoFieldNumber: 8)
+      }
+      if _optionalSfixed32 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufSFixed32.self, value: _optionalSfixed32, protoFieldNumber: 9)
+      }
+      if _optionalSfixed64 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufSFixed64.self, value: _optionalSfixed64, protoFieldNumber: 10)
+      }
+      if _optionalFloat != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufFloat.self, value: _optionalFloat, protoFieldNumber: 11)
+      }
+      if _optionalDouble != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufDouble.self, value: _optionalDouble, protoFieldNumber: 12)
+      }
+      if _optionalBool != false {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufBool.self, value: _optionalBool, protoFieldNumber: 13)
+      }
+      if _optionalString != "" {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: _optionalString, protoFieldNumber: 14)
+      }
+      if _optionalBytes != Data() {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufBytes.self, value: _optionalBytes, protoFieldNumber: 15)
+      }
+      if let v = _optionalNestedMessage {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 18)
+      }
+      if let v = _optionalForeignMessage {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 19)
+      }
+      if _optionalNestedEnum != Conformance_TestAllTypes.NestedEnum.foo {
+        try visitor.visitSingularField(fieldType: Conformance_TestAllTypes.NestedEnum.self, value: _optionalNestedEnum, protoFieldNumber: 21)
+      }
+      if _optionalForeignEnum != Conformance_ForeignEnum.foreignFoo {
+        try visitor.visitSingularField(fieldType: Conformance_ForeignEnum.self, value: _optionalForeignEnum, protoFieldNumber: 22)
+      }
+      if _optionalStringPiece != "" {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: _optionalStringPiece, protoFieldNumber: 24)
+      }
+      if _optionalCord != "" {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: _optionalCord, protoFieldNumber: 25)
+      }
+      if let v = _recursiveMessage {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 27)
+      }
+      if !_repeatedInt32.isEmpty {
+        try visitor.visitPackedField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _repeatedInt32, protoFieldNumber: 31)
+      }
+      if !_repeatedInt64.isEmpty {
+        try visitor.visitPackedField(fieldType: SwiftProtobuf.ProtobufInt64.self, value: _repeatedInt64, protoFieldNumber: 32)
+      }
+      if !_repeatedUint32.isEmpty {
+        try visitor.visitPackedField(fieldType: SwiftProtobuf.ProtobufUInt32.self, value: _repeatedUint32, protoFieldNumber: 33)
+      }
+      if !_repeatedUint64.isEmpty {
+        try visitor.visitPackedField(fieldType: SwiftProtobuf.ProtobufUInt64.self, value: _repeatedUint64, protoFieldNumber: 34)
+      }
+      if !_repeatedSint32.isEmpty {
+        try visitor.visitPackedField(fieldType: SwiftProtobuf.ProtobufSInt32.self, value: _repeatedSint32, protoFieldNumber: 35)
+      }
+      if !_repeatedSint64.isEmpty {
+        try visitor.visitPackedField(fieldType: SwiftProtobuf.ProtobufSInt64.self, value: _repeatedSint64, protoFieldNumber: 36)
+      }
+      if !_repeatedFixed32.isEmpty {
+        try visitor.visitPackedField(fieldType: SwiftProtobuf.ProtobufFixed32.self, value: _repeatedFixed32, protoFieldNumber: 37)
+      }
+      if !_repeatedFixed64.isEmpty {
+        try visitor.visitPackedField(fieldType: SwiftProtobuf.ProtobufFixed64.self, value: _repeatedFixed64, protoFieldNumber: 38)
+      }
+      if !_repeatedSfixed32.isEmpty {
+        try visitor.visitPackedField(fieldType: SwiftProtobuf.ProtobufSFixed32.self, value: _repeatedSfixed32, protoFieldNumber: 39)
+      }
+      if !_repeatedSfixed64.isEmpty {
+        try visitor.visitPackedField(fieldType: SwiftProtobuf.ProtobufSFixed64.self, value: _repeatedSfixed64, protoFieldNumber: 40)
+      }
+      if !_repeatedFloat.isEmpty {
+        try visitor.visitPackedField(fieldType: SwiftProtobuf.ProtobufFloat.self, value: _repeatedFloat, protoFieldNumber: 41)
+      }
+      if !_repeatedDouble.isEmpty {
+        try visitor.visitPackedField(fieldType: SwiftProtobuf.ProtobufDouble.self, value: _repeatedDouble, protoFieldNumber: 42)
+      }
+      if !_repeatedBool.isEmpty {
+        try visitor.visitPackedField(fieldType: SwiftProtobuf.ProtobufBool.self, value: _repeatedBool, protoFieldNumber: 43)
+      }
+      if !_repeatedString.isEmpty {
+        try visitor.visitRepeatedField(fieldType: SwiftProtobuf.ProtobufString.self, value: _repeatedString, protoFieldNumber: 44)
+      }
+      if !_repeatedBytes.isEmpty {
+        try visitor.visitRepeatedField(fieldType: SwiftProtobuf.ProtobufBytes.self, value: _repeatedBytes, protoFieldNumber: 45)
+      }
+      if !_repeatedNestedMessage.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedNestedMessage, protoFieldNumber: 48)
+      }
+      if !_repeatedForeignMessage.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedForeignMessage, protoFieldNumber: 49)
+      }
+      if !_repeatedNestedEnum.isEmpty {
+        try visitor.visitPackedField(fieldType: Conformance_TestAllTypes.NestedEnum.self, value: _repeatedNestedEnum, protoFieldNumber: 51)
+      }
+      if !_repeatedForeignEnum.isEmpty {
+        try visitor.visitPackedField(fieldType: Conformance_ForeignEnum.self, value: _repeatedForeignEnum, protoFieldNumber: 52)
+      }
+      if !_repeatedStringPiece.isEmpty {
+        try visitor.visitRepeatedField(fieldType: SwiftProtobuf.ProtobufString.self, value: _repeatedStringPiece, protoFieldNumber: 54)
+      }
+      if !_repeatedCord.isEmpty {
+        try visitor.visitRepeatedField(fieldType: SwiftProtobuf.ProtobufString.self, value: _repeatedCord, protoFieldNumber: 55)
+      }
+      if !_mapInt32Int32.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: _mapInt32Int32, protoFieldNumber: 56)
+      }
+      if !_mapInt64Int64.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufInt64,SwiftProtobuf.ProtobufInt64>.self, value: _mapInt64Int64, protoFieldNumber: 57)
+      }
+      if !_mapUint32Uint32.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufUInt32,SwiftProtobuf.ProtobufUInt32>.self, value: _mapUint32Uint32, protoFieldNumber: 58)
+      }
+      if !_mapUint64Uint64.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufUInt64,SwiftProtobuf.ProtobufUInt64>.self, value: _mapUint64Uint64, protoFieldNumber: 59)
+      }
+      if !_mapSint32Sint32.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufSInt32,SwiftProtobuf.ProtobufSInt32>.self, value: _mapSint32Sint32, protoFieldNumber: 60)
+      }
+      if !_mapSint64Sint64.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufSInt64,SwiftProtobuf.ProtobufSInt64>.self, value: _mapSint64Sint64, protoFieldNumber: 61)
+      }
+      if !_mapFixed32Fixed32.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufFixed32,SwiftProtobuf.ProtobufFixed32>.self, value: _mapFixed32Fixed32, protoFieldNumber: 62)
+      }
+      if !_mapFixed64Fixed64.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufFixed64,SwiftProtobuf.ProtobufFixed64>.self, value: _mapFixed64Fixed64, protoFieldNumber: 63)
+      }
+      if !_mapSfixed32Sfixed32.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufSFixed32,SwiftProtobuf.ProtobufSFixed32>.self, value: _mapSfixed32Sfixed32, protoFieldNumber: 64)
+      }
+      if !_mapSfixed64Sfixed64.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufSFixed64,SwiftProtobuf.ProtobufSFixed64>.self, value: _mapSfixed64Sfixed64, protoFieldNumber: 65)
+      }
+      if !_mapInt32Float.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufFloat>.self, value: _mapInt32Float, protoFieldNumber: 66)
+      }
+      if !_mapInt32Double.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufDouble>.self, value: _mapInt32Double, protoFieldNumber: 67)
+      }
+      if !_mapBoolBool.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufBool,SwiftProtobuf.ProtobufBool>.self, value: _mapBoolBool, protoFieldNumber: 68)
+      }
+      if !_mapStringString.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: _mapStringString, protoFieldNumber: 69)
+      }
+      if !_mapStringBytes.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufBytes>.self, value: _mapStringBytes, protoFieldNumber: 70)
+      }
+      if !_mapStringNestedMessage.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufString,Conformance_TestAllTypes.NestedMessage>.self, value: _mapStringNestedMessage, protoFieldNumber: 71)
+      }
+      if !_mapStringForeignMessage.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufString,Conformance_ForeignMessage>.self, value: _mapStringForeignMessage, protoFieldNumber: 72)
+      }
+      if !_mapStringNestedEnum.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufString,Conformance_TestAllTypes.NestedEnum>.self, value: _mapStringNestedEnum, protoFieldNumber: 73)
+      }
+      if !_mapStringForeignEnum.isEmpty {
+        try visitor.visitMapField(fieldType: SwiftProtobuf.ProtobufMap<SwiftProtobuf.ProtobufString,Conformance_ForeignEnum>.self, value: _mapStringForeignEnum, protoFieldNumber: 74)
+      }
+      try _oneofField.traverse(visitor: &visitor, start: 111, end: 120)
+      if let v = _optionalBoolWrapper {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 201)
+      }
+      if let v = _optionalInt32Wrapper {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 202)
+      }
+      if let v = _optionalInt64Wrapper {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 203)
+      }
+      if let v = _optionalUint32Wrapper {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 204)
+      }
+      if let v = _optionalUint64Wrapper {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 205)
+      }
+      if let v = _optionalFloatWrapper {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 206)
+      }
+      if let v = _optionalDoubleWrapper {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 207)
+      }
+      if let v = _optionalStringWrapper {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 208)
+      }
+      if let v = _optionalBytesWrapper {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 209)
+      }
+      if !_repeatedBoolWrapper.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedBoolWrapper, protoFieldNumber: 211)
+      }
+      if !_repeatedInt32Wrapper.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedInt32Wrapper, protoFieldNumber: 212)
+      }
+      if !_repeatedInt64Wrapper.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedInt64Wrapper, protoFieldNumber: 213)
+      }
+      if !_repeatedUint32Wrapper.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedUint32Wrapper, protoFieldNumber: 214)
+      }
+      if !_repeatedUint64Wrapper.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedUint64Wrapper, protoFieldNumber: 215)
+      }
+      if !_repeatedFloatWrapper.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedFloatWrapper, protoFieldNumber: 216)
+      }
+      if !_repeatedDoubleWrapper.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedDoubleWrapper, protoFieldNumber: 217)
+      }
+      if !_repeatedStringWrapper.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedStringWrapper, protoFieldNumber: 218)
+      }
+      if !_repeatedBytesWrapper.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedBytesWrapper, protoFieldNumber: 219)
+      }
+      if let v = _optionalDuration {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 301)
+      }
+      if let v = _optionalTimestamp {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 302)
+      }
+      if let v = _optionalFieldMask {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 303)
+      }
+      if let v = _optionalStruct {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 304)
+      }
+      if let v = _optionalAny {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 305)
+      }
+      if let v = _optionalValue {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 306)
+      }
+      if !_repeatedDuration.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedDuration, protoFieldNumber: 311)
+      }
+      if !_repeatedTimestamp.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedTimestamp, protoFieldNumber: 312)
+      }
+      if !_repeatedFieldmask.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedFieldmask, protoFieldNumber: 313)
+      }
+      if !_repeatedAny.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedAny, protoFieldNumber: 315)
+      }
+      if !_repeatedValue.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedValue, protoFieldNumber: 316)
+      }
+      if !_repeatedStruct.isEmpty {
+        try visitor.visitRepeatedMessageField(value: _repeatedStruct, protoFieldNumber: 324)
+      }
+      if _fieldname1 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _fieldname1, protoFieldNumber: 401)
+      }
+      if _fieldName2 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _fieldName2, protoFieldNumber: 402)
+      }
+      if _fieldName3 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _fieldName3, protoFieldNumber: 403)
+      }
+      if _field_Name4_ != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _field_Name4_, protoFieldNumber: 404)
+      }
+      if _field0Name5 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _field0Name5, protoFieldNumber: 405)
+      }
+      if _field0Name6 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _field0Name6, protoFieldNumber: 406)
+      }
+      if _fieldName7 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _fieldName7, protoFieldNumber: 407)
+      }
+      if _fieldName8 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _fieldName8, protoFieldNumber: 408)
+      }
+      if _fieldName9 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _fieldName9, protoFieldNumber: 409)
+      }
+      if _fieldName10 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _fieldName10, protoFieldNumber: 410)
+      }
+      if _fieldName11 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _fieldName11, protoFieldNumber: 411)
+      }
+      if _fieldName12 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _fieldName12, protoFieldNumber: 412)
+      }
+      if __FieldName13 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: __FieldName13, protoFieldNumber: 413)
+      }
+      if __FieldName14 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: __FieldName14, protoFieldNumber: 414)
+      }
+      if _field_Name15 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _field_Name15, protoFieldNumber: 415)
+      }
+      if _field_Name16 != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _field_Name16, protoFieldNumber: 416)
+      }
+      if _fieldName17__ != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _fieldName17__, protoFieldNumber: 417)
+      }
+      if _fieldName18__ != 0 {
+        try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _fieldName18__, protoFieldNumber: 418)
+      }
+    }
+
+    func isEqualTo(other: _StorageClass) -> Bool {
+      if _optionalInt32 != other._optionalInt32 {return false}
+      if _optionalInt64 != other._optionalInt64 {return false}
+      if _optionalUint32 != other._optionalUint32 {return false}
+      if _optionalUint64 != other._optionalUint64 {return false}
+      if _optionalSint32 != other._optionalSint32 {return false}
+      if _optionalSint64 != other._optionalSint64 {return false}
+      if _optionalFixed32 != other._optionalFixed32 {return false}
+      if _optionalFixed64 != other._optionalFixed64 {return false}
+      if _optionalSfixed32 != other._optionalSfixed32 {return false}
+      if _optionalSfixed64 != other._optionalSfixed64 {return false}
+      if _optionalFloat != other._optionalFloat {return false}
+      if _optionalDouble != other._optionalDouble {return false}
+      if _optionalBool != other._optionalBool {return false}
+      if _optionalString != other._optionalString {return false}
+      if _optionalBytes != other._optionalBytes {return false}
+      if _optionalNestedMessage != other._optionalNestedMessage {return false}
+      if _optionalForeignMessage != other._optionalForeignMessage {return false}
+      if _optionalNestedEnum != other._optionalNestedEnum {return false}
+      if _optionalForeignEnum != other._optionalForeignEnum {return false}
+      if _optionalStringPiece != other._optionalStringPiece {return false}
+      if _optionalCord != other._optionalCord {return false}
+      if _recursiveMessage != other._recursiveMessage {return false}
+      if _repeatedInt32 != other._repeatedInt32 {return false}
+      if _repeatedInt64 != other._repeatedInt64 {return false}
+      if _repeatedUint32 != other._repeatedUint32 {return false}
+      if _repeatedUint64 != other._repeatedUint64 {return false}
+      if _repeatedSint32 != other._repeatedSint32 {return false}
+      if _repeatedSint64 != other._repeatedSint64 {return false}
+      if _repeatedFixed32 != other._repeatedFixed32 {return false}
+      if _repeatedFixed64 != other._repeatedFixed64 {return false}
+      if _repeatedSfixed32 != other._repeatedSfixed32 {return false}
+      if _repeatedSfixed64 != other._repeatedSfixed64 {return false}
+      if _repeatedFloat != other._repeatedFloat {return false}
+      if _repeatedDouble != other._repeatedDouble {return false}
+      if _repeatedBool != other._repeatedBool {return false}
+      if _repeatedString != other._repeatedString {return false}
+      if _repeatedBytes != other._repeatedBytes {return false}
+      if _repeatedNestedMessage != other._repeatedNestedMessage {return false}
+      if _repeatedForeignMessage != other._repeatedForeignMessage {return false}
+      if _repeatedNestedEnum != other._repeatedNestedEnum {return false}
+      if _repeatedForeignEnum != other._repeatedForeignEnum {return false}
+      if _repeatedStringPiece != other._repeatedStringPiece {return false}
+      if _repeatedCord != other._repeatedCord {return false}
+      if _mapInt32Int32 != other._mapInt32Int32 {return false}
+      if _mapInt64Int64 != other._mapInt64Int64 {return false}
+      if _mapUint32Uint32 != other._mapUint32Uint32 {return false}
+      if _mapUint64Uint64 != other._mapUint64Uint64 {return false}
+      if _mapSint32Sint32 != other._mapSint32Sint32 {return false}
+      if _mapSint64Sint64 != other._mapSint64Sint64 {return false}
+      if _mapFixed32Fixed32 != other._mapFixed32Fixed32 {return false}
+      if _mapFixed64Fixed64 != other._mapFixed64Fixed64 {return false}
+      if _mapSfixed32Sfixed32 != other._mapSfixed32Sfixed32 {return false}
+      if _mapSfixed64Sfixed64 != other._mapSfixed64Sfixed64 {return false}
+      if _mapInt32Float != other._mapInt32Float {return false}
+      if _mapInt32Double != other._mapInt32Double {return false}
+      if _mapBoolBool != other._mapBoolBool {return false}
+      if _mapStringString != other._mapStringString {return false}
+      if _mapStringBytes != other._mapStringBytes {return false}
+      if _mapStringNestedMessage != other._mapStringNestedMessage {return false}
+      if _mapStringForeignMessage != other._mapStringForeignMessage {return false}
+      if _mapStringNestedEnum != other._mapStringNestedEnum {return false}
+      if _mapStringForeignEnum != other._mapStringForeignEnum {return false}
+      if _oneofField != other._oneofField {return false}
+      if _optionalBoolWrapper != other._optionalBoolWrapper {return false}
+      if _optionalInt32Wrapper != other._optionalInt32Wrapper {return false}
+      if _optionalInt64Wrapper != other._optionalInt64Wrapper {return false}
+      if _optionalUint32Wrapper != other._optionalUint32Wrapper {return false}
+      if _optionalUint64Wrapper != other._optionalUint64Wrapper {return false}
+      if _optionalFloatWrapper != other._optionalFloatWrapper {return false}
+      if _optionalDoubleWrapper != other._optionalDoubleWrapper {return false}
+      if _optionalStringWrapper != other._optionalStringWrapper {return false}
+      if _optionalBytesWrapper != other._optionalBytesWrapper {return false}
+      if _repeatedBoolWrapper != other._repeatedBoolWrapper {return false}
+      if _repeatedInt32Wrapper != other._repeatedInt32Wrapper {return false}
+      if _repeatedInt64Wrapper != other._repeatedInt64Wrapper {return false}
+      if _repeatedUint32Wrapper != other._repeatedUint32Wrapper {return false}
+      if _repeatedUint64Wrapper != other._repeatedUint64Wrapper {return false}
+      if _repeatedFloatWrapper != other._repeatedFloatWrapper {return false}
+      if _repeatedDoubleWrapper != other._repeatedDoubleWrapper {return false}
+      if _repeatedStringWrapper != other._repeatedStringWrapper {return false}
+      if _repeatedBytesWrapper != other._repeatedBytesWrapper {return false}
+      if _optionalDuration != other._optionalDuration {return false}
+      if _optionalTimestamp != other._optionalTimestamp {return false}
+      if _optionalFieldMask != other._optionalFieldMask {return false}
+      if _optionalStruct != other._optionalStruct {return false}
+      if _optionalAny != other._optionalAny {return false}
+      if _optionalValue != other._optionalValue {return false}
+      if _repeatedDuration != other._repeatedDuration {return false}
+      if _repeatedTimestamp != other._repeatedTimestamp {return false}
+      if _repeatedFieldmask != other._repeatedFieldmask {return false}
+      if _repeatedStruct != other._repeatedStruct {return false}
+      if _repeatedAny != other._repeatedAny {return false}
+      if _repeatedValue != other._repeatedValue {return false}
+      if _fieldname1 != other._fieldname1 {return false}
+      if _fieldName2 != other._fieldName2 {return false}
+      if _fieldName3 != other._fieldName3 {return false}
+      if _field_Name4_ != other._field_Name4_ {return false}
+      if _field0Name5 != other._field0Name5 {return false}
+      if _field0Name6 != other._field0Name6 {return false}
+      if _fieldName7 != other._fieldName7 {return false}
+      if _fieldName8 != other._fieldName8 {return false}
+      if _fieldName9 != other._fieldName9 {return false}
+      if _fieldName10 != other._fieldName10 {return false}
+      if _fieldName11 != other._fieldName11 {return false}
+      if _fieldName12 != other._fieldName12 {return false}
+      if __FieldName13 != other.__FieldName13 {return false}
+      if __FieldName14 != other.__FieldName14 {return false}
+      if _field_Name15 != other._field_Name15 {return false}
+      if _field_Name16 != other._field_Name16 {return false}
+      if _fieldName17__ != other._fieldName17__ {return false}
+      if _fieldName18__ != other._fieldName18__ {return false}
+      return true
+    }
+
+    func copy() -> _StorageClass {
+      let clone = _StorageClass()
+      clone._optionalInt32 = _optionalInt32
+      clone._optionalInt64 = _optionalInt64
+      clone._optionalUint32 = _optionalUint32
+      clone._optionalUint64 = _optionalUint64
+      clone._optionalSint32 = _optionalSint32
+      clone._optionalSint64 = _optionalSint64
+      clone._optionalFixed32 = _optionalFixed32
+      clone._optionalFixed64 = _optionalFixed64
+      clone._optionalSfixed32 = _optionalSfixed32
+      clone._optionalSfixed64 = _optionalSfixed64
+      clone._optionalFloat = _optionalFloat
+      clone._optionalDouble = _optionalDouble
+      clone._optionalBool = _optionalBool
+      clone._optionalString = _optionalString
+      clone._optionalBytes = _optionalBytes
+      clone._optionalNestedMessage = _optionalNestedMessage
+      clone._optionalForeignMessage = _optionalForeignMessage
+      clone._optionalNestedEnum = _optionalNestedEnum
+      clone._optionalForeignEnum = _optionalForeignEnum
+      clone._optionalStringPiece = _optionalStringPiece
+      clone._optionalCord = _optionalCord
+      clone._recursiveMessage = _recursiveMessage
+      clone._repeatedInt32 = _repeatedInt32
+      clone._repeatedInt64 = _repeatedInt64
+      clone._repeatedUint32 = _repeatedUint32
+      clone._repeatedUint64 = _repeatedUint64
+      clone._repeatedSint32 = _repeatedSint32
+      clone._repeatedSint64 = _repeatedSint64
+      clone._repeatedFixed32 = _repeatedFixed32
+      clone._repeatedFixed64 = _repeatedFixed64
+      clone._repeatedSfixed32 = _repeatedSfixed32
+      clone._repeatedSfixed64 = _repeatedSfixed64
+      clone._repeatedFloat = _repeatedFloat
+      clone._repeatedDouble = _repeatedDouble
+      clone._repeatedBool = _repeatedBool
+      clone._repeatedString = _repeatedString
+      clone._repeatedBytes = _repeatedBytes
+      clone._repeatedNestedMessage = _repeatedNestedMessage
+      clone._repeatedForeignMessage = _repeatedForeignMessage
+      clone._repeatedNestedEnum = _repeatedNestedEnum
+      clone._repeatedForeignEnum = _repeatedForeignEnum
+      clone._repeatedStringPiece = _repeatedStringPiece
+      clone._repeatedCord = _repeatedCord
+      clone._mapInt32Int32 = _mapInt32Int32
+      clone._mapInt64Int64 = _mapInt64Int64
+      clone._mapUint32Uint32 = _mapUint32Uint32
+      clone._mapUint64Uint64 = _mapUint64Uint64
+      clone._mapSint32Sint32 = _mapSint32Sint32
+      clone._mapSint64Sint64 = _mapSint64Sint64
+      clone._mapFixed32Fixed32 = _mapFixed32Fixed32
+      clone._mapFixed64Fixed64 = _mapFixed64Fixed64
+      clone._mapSfixed32Sfixed32 = _mapSfixed32Sfixed32
+      clone._mapSfixed64Sfixed64 = _mapSfixed64Sfixed64
+      clone._mapInt32Float = _mapInt32Float
+      clone._mapInt32Double = _mapInt32Double
+      clone._mapBoolBool = _mapBoolBool
+      clone._mapStringString = _mapStringString
+      clone._mapStringBytes = _mapStringBytes
+      clone._mapStringNestedMessage = _mapStringNestedMessage
+      clone._mapStringForeignMessage = _mapStringForeignMessage
+      clone._mapStringNestedEnum = _mapStringNestedEnum
+      clone._mapStringForeignEnum = _mapStringForeignEnum
+      clone._oneofField = _oneofField
+      clone._optionalBoolWrapper = _optionalBoolWrapper
+      clone._optionalInt32Wrapper = _optionalInt32Wrapper
+      clone._optionalInt64Wrapper = _optionalInt64Wrapper
+      clone._optionalUint32Wrapper = _optionalUint32Wrapper
+      clone._optionalUint64Wrapper = _optionalUint64Wrapper
+      clone._optionalFloatWrapper = _optionalFloatWrapper
+      clone._optionalDoubleWrapper = _optionalDoubleWrapper
+      clone._optionalStringWrapper = _optionalStringWrapper
+      clone._optionalBytesWrapper = _optionalBytesWrapper
+      clone._repeatedBoolWrapper = _repeatedBoolWrapper
+      clone._repeatedInt32Wrapper = _repeatedInt32Wrapper
+      clone._repeatedInt64Wrapper = _repeatedInt64Wrapper
+      clone._repeatedUint32Wrapper = _repeatedUint32Wrapper
+      clone._repeatedUint64Wrapper = _repeatedUint64Wrapper
+      clone._repeatedFloatWrapper = _repeatedFloatWrapper
+      clone._repeatedDoubleWrapper = _repeatedDoubleWrapper
+      clone._repeatedStringWrapper = _repeatedStringWrapper
+      clone._repeatedBytesWrapper = _repeatedBytesWrapper
+      clone._optionalDuration = _optionalDuration
+      clone._optionalTimestamp = _optionalTimestamp
+      clone._optionalFieldMask = _optionalFieldMask
+      clone._optionalStruct = _optionalStruct
+      clone._optionalAny = _optionalAny
+      clone._optionalValue = _optionalValue
+      clone._repeatedDuration = _repeatedDuration
+      clone._repeatedTimestamp = _repeatedTimestamp
+      clone._repeatedFieldmask = _repeatedFieldmask
+      clone._repeatedStruct = _repeatedStruct
+      clone._repeatedAny = _repeatedAny
+      clone._repeatedValue = _repeatedValue
+      clone._fieldname1 = _fieldname1
+      clone._fieldName2 = _fieldName2
+      clone._fieldName3 = _fieldName3
+      clone._field_Name4_ = _field_Name4_
+      clone._field0Name5 = _field0Name5
+      clone._field0Name6 = _field0Name6
+      clone._fieldName7 = _fieldName7
+      clone._fieldName8 = _fieldName8
+      clone._fieldName9 = _fieldName9
+      clone._fieldName10 = _fieldName10
+      clone._fieldName11 = _fieldName11
+      clone._fieldName12 = _fieldName12
+      clone.__FieldName13 = __FieldName13
+      clone.__FieldName14 = __FieldName14
+      clone._field_Name15 = _field_Name15
+      clone._field_Name16 = _field_Name16
+      clone._fieldName17__ = _fieldName17__
+      clone._fieldName18__ = _fieldName18__
+      return clone
+    }
+  }
+
+  private var _storage = _StorageClass()
+
+
+  public enum OneOf_OneofField: ExpressibleByNilLiteral, SwiftProtobuf.OneofEnum {
+    case oneofUint32(UInt32)
+    case oneofNestedMessage(Conformance_TestAllTypes.NestedMessage)
+    case oneofString(String)
+    case oneofBytes(Data)
+    case oneofBool(Bool)
+    case oneofUint64(UInt64)
+    case oneofFloat(Float)
+    case oneofDouble(Double)
+    case oneofEnum(Conformance_TestAllTypes.NestedEnum)
+    case None
+
+    public init(nilLiteral: ()) {
+      self = .None
+    }
+
+    public init() {
+      self = .None
+    }
+
+    public mutating func decodeField(setter: inout SwiftProtobuf.FieldDecoder, protoFieldNumber: Int) throws {
+      if self != .None && setter.rejectConflictingOneof {
+        throw SwiftProtobuf.DecodingError.duplicatedOneOf
+      }
+      switch protoFieldNumber {
+      case 111:
+        var value = UInt32()
+        try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufUInt32.self, value: &value)
+        self = .oneofUint32(value)
+      case 112:
+        var value: Conformance_TestAllTypes.NestedMessage?
+        try setter.decodeSingularMessageField(fieldType: Conformance_TestAllTypes.NestedMessage.self, value: &value)
+        if let value = value {
+          self = .oneofNestedMessage(value)
+        }
+      case 113:
+        var value = String()
+        try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: &value)
+        self = .oneofString(value)
+      case 114:
+        var value = Data()
+        try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufBytes.self, value: &value)
+        self = .oneofBytes(value)
+      case 115:
+        var value = Bool()
+        try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufBool.self, value: &value)
+        self = .oneofBool(value)
+      case 116:
+        var value = UInt64()
+        try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufUInt64.self, value: &value)
+        self = .oneofUint64(value)
+      case 117:
+        var value = Float()
+        try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufFloat.self, value: &value)
+        self = .oneofFloat(value)
+      case 118:
+        var value = Double()
+        try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufDouble.self, value: &value)
+        self = .oneofDouble(value)
+      case 119:
+        var value = Conformance_TestAllTypes.NestedEnum()
+        try setter.decodeSingularField(fieldType: Conformance_TestAllTypes.NestedEnum.self, value: &value)
+        self = .oneofEnum(value)
+      default:
+        self = .None
+      }
+    }
+
+    public func traverse(visitor: inout SwiftProtobuf.Visitor, start: Int, end: Int) throws {
+      switch self {
+      case .oneofUint32(let v):
+        if start <= 111 && 111 < end {
+          try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufUInt32.self, value: v, protoFieldNumber: 111)
+        }
+      case .oneofNestedMessage(let v):
+        if start <= 112 && 112 < end {
+          try visitor.visitSingularMessageField(value: v, protoFieldNumber: 112)
+        }
+      case .oneofString(let v):
+        if start <= 113 && 113 < end {
+          try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufString.self, value: v, protoFieldNumber: 113)
+        }
+      case .oneofBytes(let v):
+        if start <= 114 && 114 < end {
+          try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufBytes.self, value: v, protoFieldNumber: 114)
+        }
+      case .oneofBool(let v):
+        if start <= 115 && 115 < end {
+          try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufBool.self, value: v, protoFieldNumber: 115)
+        }
+      case .oneofUint64(let v):
+        if start <= 116 && 116 < end {
+          try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufUInt64.self, value: v, protoFieldNumber: 116)
+        }
+      case .oneofFloat(let v):
+        if start <= 117 && 117 < end {
+          try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufFloat.self, value: v, protoFieldNumber: 117)
+        }
+      case .oneofDouble(let v):
+        if start <= 118 && 118 < end {
+          try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufDouble.self, value: v, protoFieldNumber: 118)
+        }
+      case .oneofEnum(let v):
+        if start <= 119 && 119 < end {
+          try visitor.visitSingularField(fieldType: Conformance_TestAllTypes.NestedEnum.self, value: v, protoFieldNumber: 119)
+        }
+      case .None:
+        break
+      }
+    }
+  }
+
+  public enum NestedEnum: SwiftProtobuf.Enum {
+    public typealias RawValue = Int
+    case foo // = 0
+    case bar // = 1
+    case baz // = 2
+
+    ///   Intentionally negative.
+    case neg // = -1
+    case UNRECOGNIZED(Int)
+
+    public init() {
+      self = .foo
+    }
+
+    public init?(rawValue: Int) {
+      switch rawValue {
+      case 0: self = .foo
+      case 1: self = .bar
+      case 2: self = .baz
+      case -1: self = .neg
+      default: self = .UNRECOGNIZED(rawValue)
+      }
+    }
+
+    public init?(name: String) {
+      switch name {
+      case "foo": self = .foo
+      case "bar": self = .bar
+      case "baz": self = .baz
+      case "neg": self = .neg
+      default: return nil
+      }
+    }
+
+    public init?(jsonName: String) {
+      switch jsonName {
+      case "FOO": self = .foo
+      case "BAR": self = .bar
+      case "BAZ": self = .baz
+      case "NEG": self = .neg
+      default: return nil
+      }
+    }
+
+    public init?(protoName: String) {
+      switch protoName {
+      case "FOO": self = .foo
+      case "BAR": self = .bar
+      case "BAZ": self = .baz
+      case "NEG": self = .neg
+      default: return nil
+      }
+    }
+
+    public var rawValue: Int {
+      get {
+        switch self {
+        case .foo: return 0
+        case .bar: return 1
+        case .baz: return 2
+        case .neg: return -1
+        case .UNRECOGNIZED(let i): return i
+        }
+      }
+    }
+
+    public var json: String {
+      get {
+        switch self {
+        case .foo: return "\"FOO\""
+        case .bar: return "\"BAR\""
+        case .baz: return "\"BAZ\""
+        case .neg: return "\"NEG\""
+        case .UNRECOGNIZED(let i): return String(i)
+        }
+      }
+    }
+
+    public var hashValue: Int { return rawValue }
+
+    public var debugDescription: String {
+      get {
+        switch self {
+        case .foo: return ".foo"
+        case .bar: return ".bar"
+        case .baz: return ".baz"
+        case .neg: return ".neg"
+        case .UNRECOGNIZED(let v): return ".UNRECOGNIZED(\(v))"
+        }
+      }
+    }
+
+  }
+
+  public struct NestedMessage: SwiftProtobuf.Message, SwiftProtobuf.Proto3Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf.ProtoNameProviding {
+    public var swiftClassName: String {return "Conformance_TestAllTypes.NestedMessage"}
+    public var protoMessageName: String {return "NestedMessage"}
+    public var protoPackageName: String {return "conformance"}
+    public static let _protobuf_fieldNames: FieldNameMap = [
+      1: .same(proto: "a", swift: "a"),
+      2: .same(proto: "corecursive", swift: "corecursive"),
+    ]
+
+    private class _StorageClass {
+      typealias ExtendedMessage = Conformance_TestAllTypes.NestedMessage
+      var _a: Int32 = 0
+      var _corecursive: Conformance_TestAllTypes? = nil
+
+      init() {}
+
+      func decodeField(setter: inout SwiftProtobuf.FieldDecoder, protoFieldNumber: Int) throws {
+        switch protoFieldNumber {
+        case 1: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &_a)
+        case 2: try setter.decodeSingularMessageField(fieldType: Conformance_TestAllTypes.self, value: &_corecursive)
+        default: break
+        }
+      }
+
+      func traverse(visitor: inout SwiftProtobuf.Visitor) throws {
+        if _a != 0 {
+          try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: _a, protoFieldNumber: 1)
+        }
+        if let v = _corecursive {
+          try visitor.visitSingularMessageField(value: v, protoFieldNumber: 2)
+        }
+      }
+
+      func isEqualTo(other: _StorageClass) -> Bool {
+        if _a != other._a {return false}
+        if _corecursive != other._corecursive {return false}
+        return true
+      }
+
+      func copy() -> _StorageClass {
+        let clone = _StorageClass()
+        clone._a = _a
+        clone._corecursive = _corecursive
+        return clone
+      }
+    }
+
+    private var _storage = _StorageClass()
+
+
+    public var a: Int32 {
+      get {return _storage._a}
+      set {_uniqueStorage()._a = newValue}
+    }
+
+    public var corecursive: Conformance_TestAllTypes {
+      get {return _storage._corecursive ?? Conformance_TestAllTypes()}
+      set {_uniqueStorage()._corecursive = newValue}
+    }
+    public var hasCorecursive: Bool {
+      return _storage._corecursive != nil
+    }
+    public mutating func clearCorecursive() {
+      return _storage._corecursive = nil
+    }
+
+    public init() {}
+
+    public mutating func _protoc_generated_decodeField(setter: inout SwiftProtobuf.FieldDecoder, protoFieldNumber: Int) throws {
+      try _uniqueStorage().decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+    }
+
+    public func _protoc_generated_traverse(visitor: inout SwiftProtobuf.Visitor) throws {
+      try _storage.traverse(visitor: &visitor)
+    }
+
+    public func _protoc_generated_isEqualTo(other: Conformance_TestAllTypes.NestedMessage) -> Bool {
+      return _storage === other._storage || _storage.isEqualTo(other: other._storage)
+    }
+
+    private mutating func _uniqueStorage() -> _StorageClass {
+      if !isKnownUniquelyReferenced(&_storage) {
+        _storage = _storage.copy()
+      }
+      return _storage
+    }
+  }
+
+  ///   Singular
+  public var optionalInt32: Int32 {
+    get {return _storage._optionalInt32}
+    set {_uniqueStorage()._optionalInt32 = newValue}
+  }
+
+  public var optionalInt64: Int64 {
+    get {return _storage._optionalInt64}
+    set {_uniqueStorage()._optionalInt64 = newValue}
+  }
+
+  public var optionalUint32: UInt32 {
+    get {return _storage._optionalUint32}
+    set {_uniqueStorage()._optionalUint32 = newValue}
+  }
+
+  public var optionalUint64: UInt64 {
+    get {return _storage._optionalUint64}
+    set {_uniqueStorage()._optionalUint64 = newValue}
+  }
+
+  public var optionalSint32: Int32 {
+    get {return _storage._optionalSint32}
+    set {_uniqueStorage()._optionalSint32 = newValue}
+  }
+
+  public var optionalSint64: Int64 {
+    get {return _storage._optionalSint64}
+    set {_uniqueStorage()._optionalSint64 = newValue}
+  }
+
+  public var optionalFixed32: UInt32 {
+    get {return _storage._optionalFixed32}
+    set {_uniqueStorage()._optionalFixed32 = newValue}
+  }
+
+  public var optionalFixed64: UInt64 {
+    get {return _storage._optionalFixed64}
+    set {_uniqueStorage()._optionalFixed64 = newValue}
+  }
+
+  public var optionalSfixed32: Int32 {
+    get {return _storage._optionalSfixed32}
+    set {_uniqueStorage()._optionalSfixed32 = newValue}
+  }
+
+  public var optionalSfixed64: Int64 {
+    get {return _storage._optionalSfixed64}
+    set {_uniqueStorage()._optionalSfixed64 = newValue}
+  }
+
+  public var optionalFloat: Float {
+    get {return _storage._optionalFloat}
+    set {_uniqueStorage()._optionalFloat = newValue}
+  }
+
+  public var optionalDouble: Double {
+    get {return _storage._optionalDouble}
+    set {_uniqueStorage()._optionalDouble = newValue}
+  }
+
+  public var optionalBool: Bool {
+    get {return _storage._optionalBool}
+    set {_uniqueStorage()._optionalBool = newValue}
+  }
+
+  public var optionalString: String {
+    get {return _storage._optionalString}
+    set {_uniqueStorage()._optionalString = newValue}
+  }
+
+  public var optionalBytes: Data {
+    get {return _storage._optionalBytes}
+    set {_uniqueStorage()._optionalBytes = newValue}
+  }
+
+  public var optionalNestedMessage: Conformance_TestAllTypes.NestedMessage {
+    get {return _storage._optionalNestedMessage ?? Conformance_TestAllTypes.NestedMessage()}
+    set {_uniqueStorage()._optionalNestedMessage = newValue}
+  }
+  public var hasOptionalNestedMessage: Bool {
+    return _storage._optionalNestedMessage != nil
+  }
+  public mutating func clearOptionalNestedMessage() {
+    return _storage._optionalNestedMessage = nil
+  }
+
+  public var optionalForeignMessage: Conformance_ForeignMessage {
+    get {return _storage._optionalForeignMessage ?? Conformance_ForeignMessage()}
+    set {_uniqueStorage()._optionalForeignMessage = newValue}
+  }
+  public var hasOptionalForeignMessage: Bool {
+    return _storage._optionalForeignMessage != nil
+  }
+  public mutating func clearOptionalForeignMessage() {
+    return _storage._optionalForeignMessage = nil
+  }
+
+  public var optionalNestedEnum: Conformance_TestAllTypes.NestedEnum {
+    get {return _storage._optionalNestedEnum}
+    set {_uniqueStorage()._optionalNestedEnum = newValue}
+  }
+
+  public var optionalForeignEnum: Conformance_ForeignEnum {
+    get {return _storage._optionalForeignEnum}
+    set {_uniqueStorage()._optionalForeignEnum = newValue}
+  }
+
+  public var optionalStringPiece: String {
+    get {return _storage._optionalStringPiece}
+    set {_uniqueStorage()._optionalStringPiece = newValue}
+  }
+
+  public var optionalCord: String {
+    get {return _storage._optionalCord}
+    set {_uniqueStorage()._optionalCord = newValue}
+  }
+
+  public var recursiveMessage: Conformance_TestAllTypes {
+    get {return _storage._recursiveMessage ?? Conformance_TestAllTypes()}
+    set {_uniqueStorage()._recursiveMessage = newValue}
+  }
+  public var hasRecursiveMessage: Bool {
+    return _storage._recursiveMessage != nil
+  }
+  public mutating func clearRecursiveMessage() {
+    return _storage._recursiveMessage = nil
+  }
+
+  ///   Repeated
+  public var repeatedInt32: [Int32] {
+    get {return _storage._repeatedInt32}
+    set {_uniqueStorage()._repeatedInt32 = newValue}
+  }
+
+  public var repeatedInt64: [Int64] {
+    get {return _storage._repeatedInt64}
+    set {_uniqueStorage()._repeatedInt64 = newValue}
+  }
+
+  public var repeatedUint32: [UInt32] {
+    get {return _storage._repeatedUint32}
+    set {_uniqueStorage()._repeatedUint32 = newValue}
+  }
+
+  public var repeatedUint64: [UInt64] {
+    get {return _storage._repeatedUint64}
+    set {_uniqueStorage()._repeatedUint64 = newValue}
+  }
+
+  public var repeatedSint32: [Int32] {
+    get {return _storage._repeatedSint32}
+    set {_uniqueStorage()._repeatedSint32 = newValue}
+  }
+
+  public var repeatedSint64: [Int64] {
+    get {return _storage._repeatedSint64}
+    set {_uniqueStorage()._repeatedSint64 = newValue}
+  }
+
+  public var repeatedFixed32: [UInt32] {
+    get {return _storage._repeatedFixed32}
+    set {_uniqueStorage()._repeatedFixed32 = newValue}
+  }
+
+  public var repeatedFixed64: [UInt64] {
+    get {return _storage._repeatedFixed64}
+    set {_uniqueStorage()._repeatedFixed64 = newValue}
+  }
+
+  public var repeatedSfixed32: [Int32] {
+    get {return _storage._repeatedSfixed32}
+    set {_uniqueStorage()._repeatedSfixed32 = newValue}
+  }
+
+  public var repeatedSfixed64: [Int64] {
+    get {return _storage._repeatedSfixed64}
+    set {_uniqueStorage()._repeatedSfixed64 = newValue}
+  }
+
+  public var repeatedFloat: [Float] {
+    get {return _storage._repeatedFloat}
+    set {_uniqueStorage()._repeatedFloat = newValue}
+  }
+
+  public var repeatedDouble: [Double] {
+    get {return _storage._repeatedDouble}
+    set {_uniqueStorage()._repeatedDouble = newValue}
+  }
+
+  public var repeatedBool: [Bool] {
+    get {return _storage._repeatedBool}
+    set {_uniqueStorage()._repeatedBool = newValue}
+  }
+
+  public var repeatedString: [String] {
+    get {return _storage._repeatedString}
+    set {_uniqueStorage()._repeatedString = newValue}
+  }
+
+  public var repeatedBytes: [Data] {
+    get {return _storage._repeatedBytes}
+    set {_uniqueStorage()._repeatedBytes = newValue}
+  }
+
+  public var repeatedNestedMessage: [Conformance_TestAllTypes.NestedMessage] {
+    get {return _storage._repeatedNestedMessage}
+    set {_uniqueStorage()._repeatedNestedMessage = newValue}
+  }
+
+  public var repeatedForeignMessage: [Conformance_ForeignMessage] {
+    get {return _storage._repeatedForeignMessage}
+    set {_uniqueStorage()._repeatedForeignMessage = newValue}
+  }
+
+  public var repeatedNestedEnum: [Conformance_TestAllTypes.NestedEnum] {
+    get {return _storage._repeatedNestedEnum}
+    set {_uniqueStorage()._repeatedNestedEnum = newValue}
+  }
+
+  public var repeatedForeignEnum: [Conformance_ForeignEnum] {
+    get {return _storage._repeatedForeignEnum}
+    set {_uniqueStorage()._repeatedForeignEnum = newValue}
+  }
+
+  public var repeatedStringPiece: [String] {
+    get {return _storage._repeatedStringPiece}
+    set {_uniqueStorage()._repeatedStringPiece = newValue}
+  }
+
+  public var repeatedCord: [String] {
+    get {return _storage._repeatedCord}
+    set {_uniqueStorage()._repeatedCord = newValue}
+  }
+
+  ///   Map
+  public var mapInt32Int32: Dictionary<Int32,Int32> {
+    get {return _storage._mapInt32Int32}
+    set {_uniqueStorage()._mapInt32Int32 = newValue}
+  }
+
+  public var mapInt64Int64: Dictionary<Int64,Int64> {
+    get {return _storage._mapInt64Int64}
+    set {_uniqueStorage()._mapInt64Int64 = newValue}
+  }
+
+  public var mapUint32Uint32: Dictionary<UInt32,UInt32> {
+    get {return _storage._mapUint32Uint32}
+    set {_uniqueStorage()._mapUint32Uint32 = newValue}
+  }
+
+  public var mapUint64Uint64: Dictionary<UInt64,UInt64> {
+    get {return _storage._mapUint64Uint64}
+    set {_uniqueStorage()._mapUint64Uint64 = newValue}
+  }
+
+  public var mapSint32Sint32: Dictionary<Int32,Int32> {
+    get {return _storage._mapSint32Sint32}
+    set {_uniqueStorage()._mapSint32Sint32 = newValue}
+  }
+
+  public var mapSint64Sint64: Dictionary<Int64,Int64> {
+    get {return _storage._mapSint64Sint64}
+    set {_uniqueStorage()._mapSint64Sint64 = newValue}
+  }
+
+  public var mapFixed32Fixed32: Dictionary<UInt32,UInt32> {
+    get {return _storage._mapFixed32Fixed32}
+    set {_uniqueStorage()._mapFixed32Fixed32 = newValue}
+  }
+
+  public var mapFixed64Fixed64: Dictionary<UInt64,UInt64> {
+    get {return _storage._mapFixed64Fixed64}
+    set {_uniqueStorage()._mapFixed64Fixed64 = newValue}
+  }
+
+  public var mapSfixed32Sfixed32: Dictionary<Int32,Int32> {
+    get {return _storage._mapSfixed32Sfixed32}
+    set {_uniqueStorage()._mapSfixed32Sfixed32 = newValue}
+  }
+
+  public var mapSfixed64Sfixed64: Dictionary<Int64,Int64> {
+    get {return _storage._mapSfixed64Sfixed64}
+    set {_uniqueStorage()._mapSfixed64Sfixed64 = newValue}
+  }
+
+  public var mapInt32Float: Dictionary<Int32,Float> {
+    get {return _storage._mapInt32Float}
+    set {_uniqueStorage()._mapInt32Float = newValue}
+  }
+
+  public var mapInt32Double: Dictionary<Int32,Double> {
+    get {return _storage._mapInt32Double}
+    set {_uniqueStorage()._mapInt32Double = newValue}
+  }
+
+  public var mapBoolBool: Dictionary<Bool,Bool> {
+    get {return _storage._mapBoolBool}
+    set {_uniqueStorage()._mapBoolBool = newValue}
+  }
+
+  public var mapStringString: Dictionary<String,String> {
+    get {return _storage._mapStringString}
+    set {_uniqueStorage()._mapStringString = newValue}
+  }
+
+  public var mapStringBytes: Dictionary<String,Data> {
+    get {return _storage._mapStringBytes}
+    set {_uniqueStorage()._mapStringBytes = newValue}
+  }
+
+  public var mapStringNestedMessage: Dictionary<String,Conformance_TestAllTypes.NestedMessage> {
+    get {return _storage._mapStringNestedMessage}
+    set {_uniqueStorage()._mapStringNestedMessage = newValue}
+  }
+
+  public var mapStringForeignMessage: Dictionary<String,Conformance_ForeignMessage> {
+    get {return _storage._mapStringForeignMessage}
+    set {_uniqueStorage()._mapStringForeignMessage = newValue}
+  }
+
+  public var mapStringNestedEnum: Dictionary<String,Conformance_TestAllTypes.NestedEnum> {
+    get {return _storage._mapStringNestedEnum}
+    set {_uniqueStorage()._mapStringNestedEnum = newValue}
+  }
+
+  public var mapStringForeignEnum: Dictionary<String,Conformance_ForeignEnum> {
+    get {return _storage._mapStringForeignEnum}
+    set {_uniqueStorage()._mapStringForeignEnum = newValue}
+  }
+
+  public var oneofUint32: UInt32 {
+    get {
+      if case .oneofUint32(let v) = _storage._oneofField {
+        return v
+      }
+      return 0
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofUint32(newValue)
+    }
+  }
+
+  public var oneofNestedMessage: Conformance_TestAllTypes.NestedMessage {
+    get {
+      if case .oneofNestedMessage(let v) = _storage._oneofField {
+        return v
+      }
+      return Conformance_TestAllTypes.NestedMessage()
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofNestedMessage(newValue)
+    }
+  }
+
+  public var oneofString: String {
+    get {
+      if case .oneofString(let v) = _storage._oneofField {
+        return v
+      }
+      return ""
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofString(newValue)
+    }
+  }
+
+  public var oneofBytes: Data {
+    get {
+      if case .oneofBytes(let v) = _storage._oneofField {
+        return v
+      }
+      return Data()
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofBytes(newValue)
+    }
+  }
+
+  public var oneofBool: Bool {
+    get {
+      if case .oneofBool(let v) = _storage._oneofField {
+        return v
+      }
+      return false
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofBool(newValue)
+    }
+  }
+
+  public var oneofUint64: UInt64 {
+    get {
+      if case .oneofUint64(let v) = _storage._oneofField {
+        return v
+      }
+      return 0
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofUint64(newValue)
+    }
+  }
+
+  public var oneofFloat: Float {
+    get {
+      if case .oneofFloat(let v) = _storage._oneofField {
+        return v
+      }
+      return 0
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofFloat(newValue)
+    }
+  }
+
+  public var oneofDouble: Double {
+    get {
+      if case .oneofDouble(let v) = _storage._oneofField {
+        return v
+      }
+      return 0
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofDouble(newValue)
+    }
+  }
+
+  public var oneofEnum: Conformance_TestAllTypes.NestedEnum {
+    get {
+      if case .oneofEnum(let v) = _storage._oneofField {
+        return v
+      }
+      return Conformance_TestAllTypes.NestedEnum.foo
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofEnum(newValue)
+    }
+  }
+
+  ///   Well-known types
+  public var optionalBoolWrapper: Google_Protobuf_BoolValue {
+    get {return _storage._optionalBoolWrapper ?? Google_Protobuf_BoolValue()}
+    set {_uniqueStorage()._optionalBoolWrapper = newValue}
+  }
+  public var hasOptionalBoolWrapper: Bool {
+    return _storage._optionalBoolWrapper != nil
+  }
+  public mutating func clearOptionalBoolWrapper() {
+    return _storage._optionalBoolWrapper = nil
+  }
+
+  public var optionalInt32Wrapper: Google_Protobuf_Int32Value {
+    get {return _storage._optionalInt32Wrapper ?? Google_Protobuf_Int32Value()}
+    set {_uniqueStorage()._optionalInt32Wrapper = newValue}
+  }
+  public var hasOptionalInt32Wrapper: Bool {
+    return _storage._optionalInt32Wrapper != nil
+  }
+  public mutating func clearOptionalInt32Wrapper() {
+    return _storage._optionalInt32Wrapper = nil
+  }
+
+  public var optionalInt64Wrapper: Google_Protobuf_Int64Value {
+    get {return _storage._optionalInt64Wrapper ?? Google_Protobuf_Int64Value()}
+    set {_uniqueStorage()._optionalInt64Wrapper = newValue}
+  }
+  public var hasOptionalInt64Wrapper: Bool {
+    return _storage._optionalInt64Wrapper != nil
+  }
+  public mutating func clearOptionalInt64Wrapper() {
+    return _storage._optionalInt64Wrapper = nil
+  }
+
+  public var optionalUint32Wrapper: Google_Protobuf_UInt32Value {
+    get {return _storage._optionalUint32Wrapper ?? Google_Protobuf_UInt32Value()}
+    set {_uniqueStorage()._optionalUint32Wrapper = newValue}
+  }
+  public var hasOptionalUint32Wrapper: Bool {
+    return _storage._optionalUint32Wrapper != nil
+  }
+  public mutating func clearOptionalUint32Wrapper() {
+    return _storage._optionalUint32Wrapper = nil
+  }
+
+  public var optionalUint64Wrapper: Google_Protobuf_UInt64Value {
+    get {return _storage._optionalUint64Wrapper ?? Google_Protobuf_UInt64Value()}
+    set {_uniqueStorage()._optionalUint64Wrapper = newValue}
+  }
+  public var hasOptionalUint64Wrapper: Bool {
+    return _storage._optionalUint64Wrapper != nil
+  }
+  public mutating func clearOptionalUint64Wrapper() {
+    return _storage._optionalUint64Wrapper = nil
+  }
+
+  public var optionalFloatWrapper: Google_Protobuf_FloatValue {
+    get {return _storage._optionalFloatWrapper ?? Google_Protobuf_FloatValue()}
+    set {_uniqueStorage()._optionalFloatWrapper = newValue}
+  }
+  public var hasOptionalFloatWrapper: Bool {
+    return _storage._optionalFloatWrapper != nil
+  }
+  public mutating func clearOptionalFloatWrapper() {
+    return _storage._optionalFloatWrapper = nil
+  }
+
+  public var optionalDoubleWrapper: Google_Protobuf_DoubleValue {
+    get {return _storage._optionalDoubleWrapper ?? Google_Protobuf_DoubleValue()}
+    set {_uniqueStorage()._optionalDoubleWrapper = newValue}
+  }
+  public var hasOptionalDoubleWrapper: Bool {
+    return _storage._optionalDoubleWrapper != nil
+  }
+  public mutating func clearOptionalDoubleWrapper() {
+    return _storage._optionalDoubleWrapper = nil
+  }
+
+  public var optionalStringWrapper: Google_Protobuf_StringValue {
+    get {return _storage._optionalStringWrapper ?? Google_Protobuf_StringValue()}
+    set {_uniqueStorage()._optionalStringWrapper = newValue}
+  }
+  public var hasOptionalStringWrapper: Bool {
+    return _storage._optionalStringWrapper != nil
+  }
+  public mutating func clearOptionalStringWrapper() {
+    return _storage._optionalStringWrapper = nil
+  }
+
+  public var optionalBytesWrapper: Google_Protobuf_BytesValue {
+    get {return _storage._optionalBytesWrapper ?? Google_Protobuf_BytesValue()}
+    set {_uniqueStorage()._optionalBytesWrapper = newValue}
+  }
+  public var hasOptionalBytesWrapper: Bool {
+    return _storage._optionalBytesWrapper != nil
+  }
+  public mutating func clearOptionalBytesWrapper() {
+    return _storage._optionalBytesWrapper = nil
+  }
+
+  public var repeatedBoolWrapper: [Google_Protobuf_BoolValue] {
+    get {return _storage._repeatedBoolWrapper}
+    set {_uniqueStorage()._repeatedBoolWrapper = newValue}
+  }
+
+  public var repeatedInt32Wrapper: [Google_Protobuf_Int32Value] {
+    get {return _storage._repeatedInt32Wrapper}
+    set {_uniqueStorage()._repeatedInt32Wrapper = newValue}
+  }
+
+  public var repeatedInt64Wrapper: [Google_Protobuf_Int64Value] {
+    get {return _storage._repeatedInt64Wrapper}
+    set {_uniqueStorage()._repeatedInt64Wrapper = newValue}
+  }
+
+  public var repeatedUint32Wrapper: [Google_Protobuf_UInt32Value] {
+    get {return _storage._repeatedUint32Wrapper}
+    set {_uniqueStorage()._repeatedUint32Wrapper = newValue}
+  }
+
+  public var repeatedUint64Wrapper: [Google_Protobuf_UInt64Value] {
+    get {return _storage._repeatedUint64Wrapper}
+    set {_uniqueStorage()._repeatedUint64Wrapper = newValue}
+  }
+
+  public var repeatedFloatWrapper: [Google_Protobuf_FloatValue] {
+    get {return _storage._repeatedFloatWrapper}
+    set {_uniqueStorage()._repeatedFloatWrapper = newValue}
+  }
+
+  public var repeatedDoubleWrapper: [Google_Protobuf_DoubleValue] {
+    get {return _storage._repeatedDoubleWrapper}
+    set {_uniqueStorage()._repeatedDoubleWrapper = newValue}
+  }
+
+  public var repeatedStringWrapper: [Google_Protobuf_StringValue] {
+    get {return _storage._repeatedStringWrapper}
+    set {_uniqueStorage()._repeatedStringWrapper = newValue}
+  }
+
+  public var repeatedBytesWrapper: [Google_Protobuf_BytesValue] {
+    get {return _storage._repeatedBytesWrapper}
+    set {_uniqueStorage()._repeatedBytesWrapper = newValue}
+  }
+
+  public var optionalDuration: Google_Protobuf_Duration {
+    get {return _storage._optionalDuration ?? Google_Protobuf_Duration()}
+    set {_uniqueStorage()._optionalDuration = newValue}
+  }
+  public var hasOptionalDuration: Bool {
+    return _storage._optionalDuration != nil
+  }
+  public mutating func clearOptionalDuration() {
+    return _storage._optionalDuration = nil
+  }
+
+  public var optionalTimestamp: Google_Protobuf_Timestamp {
+    get {return _storage._optionalTimestamp ?? Google_Protobuf_Timestamp()}
+    set {_uniqueStorage()._optionalTimestamp = newValue}
+  }
+  public var hasOptionalTimestamp: Bool {
+    return _storage._optionalTimestamp != nil
+  }
+  public mutating func clearOptionalTimestamp() {
+    return _storage._optionalTimestamp = nil
+  }
+
+  public var optionalFieldMask: Google_Protobuf_FieldMask {
+    get {return _storage._optionalFieldMask ?? Google_Protobuf_FieldMask()}
+    set {_uniqueStorage()._optionalFieldMask = newValue}
+  }
+  public var hasOptionalFieldMask: Bool {
+    return _storage._optionalFieldMask != nil
+  }
+  public mutating func clearOptionalFieldMask() {
+    return _storage._optionalFieldMask = nil
+  }
+
+  public var optionalStruct: Google_Protobuf_Struct {
+    get {return _storage._optionalStruct ?? Google_Protobuf_Struct()}
+    set {_uniqueStorage()._optionalStruct = newValue}
+  }
+  public var hasOptionalStruct: Bool {
+    return _storage._optionalStruct != nil
+  }
+  public mutating func clearOptionalStruct() {
+    return _storage._optionalStruct = nil
+  }
+
+  public var optionalAny: Google_Protobuf_Any {
+    get {return _storage._optionalAny ?? Google_Protobuf_Any()}
+    set {_uniqueStorage()._optionalAny = newValue}
+  }
+  public var hasOptionalAny: Bool {
+    return _storage._optionalAny != nil
+  }
+  public mutating func clearOptionalAny() {
+    return _storage._optionalAny = nil
+  }
+
+  public var optionalValue: Google_Protobuf_Value {
+    get {return _storage._optionalValue ?? Google_Protobuf_Value()}
+    set {_uniqueStorage()._optionalValue = newValue}
+  }
+  public var hasOptionalValue: Bool {
+    return _storage._optionalValue != nil
+  }
+  public mutating func clearOptionalValue() {
+    return _storage._optionalValue = nil
+  }
+
+  public var repeatedDuration: [Google_Protobuf_Duration] {
+    get {return _storage._repeatedDuration}
+    set {_uniqueStorage()._repeatedDuration = newValue}
+  }
+
+  public var repeatedTimestamp: [Google_Protobuf_Timestamp] {
+    get {return _storage._repeatedTimestamp}
+    set {_uniqueStorage()._repeatedTimestamp = newValue}
+  }
+
+  public var repeatedFieldmask: [Google_Protobuf_FieldMask] {
+    get {return _storage._repeatedFieldmask}
+    set {_uniqueStorage()._repeatedFieldmask = newValue}
+  }
+
+  public var repeatedStruct: [Google_Protobuf_Struct] {
+    get {return _storage._repeatedStruct}
+    set {_uniqueStorage()._repeatedStruct = newValue}
+  }
+
+  public var repeatedAny: [Google_Protobuf_Any] {
+    get {return _storage._repeatedAny}
+    set {_uniqueStorage()._repeatedAny = newValue}
+  }
+
+  public var repeatedValue: [Google_Protobuf_Value] {
+    get {return _storage._repeatedValue}
+    set {_uniqueStorage()._repeatedValue = newValue}
+  }
+
+  ///   Test field-name-to-JSON-name convention.
+  ///   (protobuf says names can be any valid C/C++ identifier.)
+  public var fieldname1: Int32 {
+    get {return _storage._fieldname1}
+    set {_uniqueStorage()._fieldname1 = newValue}
+  }
+
+  public var fieldName2: Int32 {
+    get {return _storage._fieldName2}
+    set {_uniqueStorage()._fieldName2 = newValue}
+  }
+
+  public var fieldName3: Int32 {
+    get {return _storage._fieldName3}
+    set {_uniqueStorage()._fieldName3 = newValue}
+  }
+
+  public var field_Name4_: Int32 {
+    get {return _storage._field_Name4_}
+    set {_uniqueStorage()._field_Name4_ = newValue}
+  }
+
+  public var field0Name5: Int32 {
+    get {return _storage._field0Name5}
+    set {_uniqueStorage()._field0Name5 = newValue}
+  }
+
+  public var field0Name6: Int32 {
+    get {return _storage._field0Name6}
+    set {_uniqueStorage()._field0Name6 = newValue}
+  }
+
+  public var fieldName7: Int32 {
+    get {return _storage._fieldName7}
+    set {_uniqueStorage()._fieldName7 = newValue}
+  }
+
+  public var fieldName8: Int32 {
+    get {return _storage._fieldName8}
+    set {_uniqueStorage()._fieldName8 = newValue}
+  }
+
+  public var fieldName9: Int32 {
+    get {return _storage._fieldName9}
+    set {_uniqueStorage()._fieldName9 = newValue}
+  }
+
+  public var fieldName10: Int32 {
+    get {return _storage._fieldName10}
+    set {_uniqueStorage()._fieldName10 = newValue}
+  }
+
+  public var fieldName11: Int32 {
+    get {return _storage._fieldName11}
+    set {_uniqueStorage()._fieldName11 = newValue}
+  }
+
+  public var fieldName12: Int32 {
+    get {return _storage._fieldName12}
+    set {_uniqueStorage()._fieldName12 = newValue}
+  }
+
+  public var _FieldName13: Int32 {
+    get {return _storage.__FieldName13}
+    set {_uniqueStorage().__FieldName13 = newValue}
+  }
+
+  public var _FieldName14: Int32 {
+    get {return _storage.__FieldName14}
+    set {_uniqueStorage().__FieldName14 = newValue}
+  }
+
+  public var field_Name15: Int32 {
+    get {return _storage._field_Name15}
+    set {_uniqueStorage()._field_Name15 = newValue}
+  }
+
+  public var field_Name16: Int32 {
+    get {return _storage._field_Name16}
+    set {_uniqueStorage()._field_Name16 = newValue}
+  }
+
+  public var fieldName17__: Int32 {
+    get {return _storage._fieldName17__}
+    set {_uniqueStorage()._fieldName17__ = newValue}
+  }
+
+  public var fieldName18__: Int32 {
+    get {return _storage._fieldName18__}
+    set {_uniqueStorage()._fieldName18__ = newValue}
+  }
+
+  public var oneofField: OneOf_OneofField {
+    get {return _storage._oneofField}
+    set {
+      _uniqueStorage()._oneofField = newValue
+    }
+  }
+
+  public init() {}
+
+  public mutating func _protoc_generated_decodeField(setter: inout SwiftProtobuf.FieldDecoder, protoFieldNumber: Int) throws {
+    try _uniqueStorage().decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+  }
+
+  public func _protoc_generated_traverse(visitor: inout SwiftProtobuf.Visitor) throws {
+    try _storage.traverse(visitor: &visitor)
+  }
+
+  public func _protoc_generated_isEqualTo(other: Conformance_TestAllTypes) -> Bool {
+    return _storage === other._storage || _storage.isEqualTo(other: other._storage)
+  }
+
+  private mutating func _uniqueStorage() -> _StorageClass {
+    if !isKnownUniquelyReferenced(&_storage) {
+      _storage = _storage.copy()
+    }
+    return _storage
+  }
+}
+
+public struct Conformance_ForeignMessage: SwiftProtobuf.Message, SwiftProtobuf.Proto3Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf.ProtoNameProviding {
+  public var swiftClassName: String {return "Conformance_ForeignMessage"}
+  public var protoMessageName: String {return "ForeignMessage"}
+  public var protoPackageName: String {return "conformance"}
+  public static let _protobuf_fieldNames: FieldNameMap = [
+    1: .same(proto: "c", swift: "c"),
+  ]
+
+
+  public var c: Int32 = 0
+
+  public init() {}
+
+  public mutating func _protoc_generated_decodeField(setter: inout SwiftProtobuf.FieldDecoder, protoFieldNumber: Int) throws {
+    switch protoFieldNumber {
+    case 1: try setter.decodeSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: &c)
+    default: break
+    }
+  }
+
+  public func _protoc_generated_traverse(visitor: inout SwiftProtobuf.Visitor) throws {
+    if c != 0 {
+      try visitor.visitSingularField(fieldType: SwiftProtobuf.ProtobufInt32.self, value: c, protoFieldNumber: 1)
+    }
+  }
+
+  public func _protoc_generated_isEqualTo(other: Conformance_ForeignMessage) -> Bool {
+    if c != other.c {return false}
+    return true
+  }
+}
+
+public func ==(lhs: Conformance_ConformanceRequest.OneOf_Payload, rhs: Conformance_ConformanceRequest.OneOf_Payload) -> Bool {
+  switch (lhs, rhs) {
+  case (.protobufPayload(let l), .protobufPayload(let r)): return l == r
+  case (.jsonPayload(let l), .jsonPayload(let r)): return l == r
+  case (.None, .None): return true
+  default: return false
+  }
+}
+
+public func ==(lhs: Conformance_ConformanceResponse.OneOf_Result, rhs: Conformance_ConformanceResponse.OneOf_Result) -> Bool {
+  switch (lhs, rhs) {
+  case (.parseError(let l), .parseError(let r)): return l == r
+  case (.serializeError(let l), .serializeError(let r)): return l == r
+  case (.runtimeError(let l), .runtimeError(let r)): return l == r
+  case (.protobufPayload(let l), .protobufPayload(let r)): return l == r
+  case (.jsonPayload(let l), .jsonPayload(let r)): return l == r
+  case (.skipped(let l), .skipped(let r)): return l == r
+  case (.None, .None): return true
+  default: return false
+  }
+}
+
+public func ==(lhs: Conformance_TestAllTypes.OneOf_OneofField, rhs: Conformance_TestAllTypes.OneOf_OneofField) -> Bool {
+  switch (lhs, rhs) {
+  case (.oneofUint32(let l), .oneofUint32(let r)): return l == r
+  case (.oneofNestedMessage(let l), .oneofNestedMessage(let r)): return l == r
+  case (.oneofString(let l), .oneofString(let r)): return l == r
+  case (.oneofBytes(let l), .oneofBytes(let r)): return l == r
+  case (.oneofBool(let l), .oneofBool(let r)): return l == r
+  case (.oneofUint64(let l), .oneofUint64(let r)): return l == r
+  case (.oneofFloat(let l), .oneofFloat(let r)): return l == r
+  case (.oneofDouble(let l), .oneofDouble(let r)): return l == r
+  case (.oneofEnum(let l), .oneofEnum(let r)): return l == r
+  case (.None, .None): return true
+  default: return false
+  }
+}

+ 127 - 0
Sources/Conformance/main.swift

@@ -0,0 +1,127 @@
+// ProtobufRuntime/Sources/Conformance/main.swift - Conformance test main
+//
+// This source file is part of the Swift.org open source project
+//
+// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
+// Licensed under Apache License v2.0 with Runtime Library Exception
+//
+// See http://swift.org/LICENSE.txt for license information
+// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
+//
+// -----------------------------------------------------------------------------
+///
+/// Google's conformance test is a C++ program that pipes data to/from another
+/// process.  The tester sends data to the test wrapper which encodes and decodes
+/// data according to the provided instructions.  This allows a single test
+/// scaffold to exercise many differnt implementations.
+///
+// -----------------------------------------------------------------------------
+
+#if os(Linux)
+import Glibc
+#else
+import Darwin.C
+#endif
+
+import Foundation
+import SwiftProtobuf
+
+func readRequest() -> Data? {
+    var rawCount: UInt32 = 0
+    let read1 = fread(&rawCount, 1, 4, stdin)
+    let count = Int(rawCount)
+    if read1 < 4 {
+        return nil
+    }
+    var buff = [UInt8](repeating: 0, count: count)
+    let read2 = fread(&buff, 1, count, stdin)
+    if read2 < count {
+        return nil
+    }
+    return Data(bytes: buff)
+}
+
+func writeResponse(data: Data) {
+    let bytes = [UInt8](data)
+    var count = UInt32(bytes.count)
+    fwrite(&count, 4, 1, stdout)
+    _ = bytes.withUnsafeBufferPointer { bp in
+        fwrite(bp.baseAddress, Int(count), 1, stdout)
+    }
+    fflush(stdout)
+}
+
+func buildResponse(protobuf: Data) -> Conformance_ConformanceResponse {
+    var response = Conformance_ConformanceResponse()
+
+    let request: Conformance_ConformanceRequest
+    do {
+        request = try Conformance_ConformanceRequest(protobuf: protobuf)
+    } catch {
+        response.runtimeError = "Failed to parse conformance request"
+        return response
+    }
+
+    let parsed: Conformance_TestAllTypes?
+    switch request.payload {
+    case .protobufPayload(let data):
+        do {
+            parsed = try Conformance_TestAllTypes(protobuf: data)
+        } catch let e {
+            response.parseError = "Protobuf failed to parse: \(e)"
+            return response
+        }
+    case .jsonPayload(let json):
+        do {
+            parsed = try Conformance_TestAllTypes(json: json)
+        } catch let e {
+            response.parseError = "JSON failed to parse: \(e)"
+            return response
+        }
+    default:
+        assert(false)
+	return response
+    }
+
+    let testMessage: Conformance_TestAllTypes
+    if let parsed = parsed {
+        testMessage = parsed
+    } else {
+        response.parseError = "Failed to parse"
+        return response
+    }
+
+    switch request.requestedOutputFormat {
+    case .protobuf:
+        do {
+            response.protobufPayload = try testMessage.serializeProtobuf()
+        } catch let e {
+            response.serializeError = "Failed to serialize: \(e)"
+        }
+    case .json_:
+        do {
+            response.jsonPayload = try testMessage.serializeJSON()
+        } catch let e {
+            response.serializeError = "Failed to serialize: \(e)"
+        }
+    default:
+        assert(false)
+    }
+    return response
+}
+
+func singleTest() throws -> Bool {
+   if let indata = readRequest() {
+       let response = buildResponse(protobuf: indata)
+       let outdata = try response.serializeProtobuf()
+       writeResponse(data: outdata)
+       return true
+   } else {
+      return false
+   }
+}
+
+Google_Protobuf_Any.register(messageType: Conformance_TestAllTypes.self)
+while try singleTest() {
+}
+

+ 9 - 0
failure_list_swift.txt

@@ -0,0 +1,9 @@
+#
+# Google's spec for transforming proto names to JSON field names
+# is currently in flux.  The following cases will likely remain
+# broken until Google finishes their specification for JSON output.
+#
+JsonInput.FieldNameInSnakeCase.JsonOutput
+JsonInput.FieldNameInSnakeCase.ProtobufOutput
+JsonInput.FieldNameWithDoubleUnderscores.JsonOutput
+JsonInput.FieldNameWithDoubleUnderscores.ProtobufOutput