فهرست منبع

Merge pull request #150 from thomasvl/update_protos

Update the protos copied from google/protobuf.
Thomas Van Lenten 9 سال پیش
والد
کامیت
81984984e8
36فایلهای تغییر یافته به همراه3284 افزوده شده و 126 حذف شده
  1. 29 3
      Makefile
  2. 12 0
      Protos/conformance/conformance.proto
  3. 0 1
      Protos/google/protobuf/any.proto
  4. 1 1
      Protos/google/protobuf/api.proto
  5. 24 18
      Protos/google/protobuf/descriptor.proto
  6. 8 1
      Protos/google/protobuf/duration.proto
  7. 0 1
      Protos/google/protobuf/empty.proto
  8. 4 4
      Protos/google/protobuf/field_mask.proto
  9. 21 1
      Protos/google/protobuf/map_proto2_unittest.proto
  10. 1 4
      Protos/google/protobuf/map_unittest_proto3.proto
  11. 1 1
      Protos/google/protobuf/source_context.proto
  12. 1 1
      Protos/google/protobuf/struct.proto
  13. 3 6
      Protos/google/protobuf/timestamp.proto
  14. 2 1
      Protos/google/protobuf/type.proto
  15. 39 0
      Protos/google/protobuf/unittest.proto
  16. 1 2
      Protos/google/protobuf/unittest_import_proto3.proto
  17. 1 2
      Protos/google/protobuf/unittest_import_public_proto3.proto
  18. 34 0
      Protos/google/protobuf/unittest_lite.proto
  19. 1 4
      Protos/google/protobuf/unittest_proto3.proto
  20. 0 1
      Protos/google/protobuf/wrappers.proto
  21. 196 2
      Reference/conformance/conformance.pb.swift
  22. 112 18
      Reference/google/protobuf/descriptor.pb.swift
  23. 6 0
      Reference/google/protobuf/duration.pb.swift
  24. 3 3
      Reference/google/protobuf/field_mask.pb.swift
  25. 159 0
      Reference/google/protobuf/map_proto2_unittest.pb.swift
  26. 3 5
      Reference/google/protobuf/timestamp.pb.swift
  27. 605 0
      Reference/google/protobuf/unittest.pb.swift
  28. 490 0
      Reference/google/protobuf/unittest_lite.pb.swift
  29. 112 18
      Sources/PluginLibrary/descriptor.pb.swift
  30. 6 0
      Sources/SwiftProtobuf/duration.pb.swift
  31. 3 3
      Sources/SwiftProtobuf/field_mask.pb.swift
  32. 3 5
      Sources/SwiftProtobuf/timestamp.pb.swift
  33. 196 2
      Tests/SwiftProtobufTests/conformance.pb.swift
  34. 112 18
      Tests/SwiftProtobufTests/descriptor.pb.swift
  35. 605 0
      Tests/SwiftProtobufTests/unittest.pb.swift
  36. 490 0
      Tests/SwiftProtobufTests/unittest_lite.pb.swift

+ 29 - 3
Makefile

@@ -38,14 +38,18 @@ AWK=awk
 # Installation directory
 BINDIR=/usr/local/bin
 
+# Install tool name
 INSTALL=install
 
-PROTOC_GEN_SWIFT=.build/debug/protoc-gen-swift
+# Where to find a google/protobufs checkout. This is only used for the
+# 'update-proto-files' target.  Defaults be being beside this checkout.
+GOOGLE_PROTOBUFS_CHECKOUT=../protobuf
 
 # Helpers for the common parts of source generation.
 #
 # To ensure that the local version of the plugin is always used (and not a
 # previously installed one), we use a custom output name (-tfiws_out).
+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
 
@@ -183,7 +187,8 @@ endif
 	test-xcode-tvOS-release \
 	test-xcode-watchOS \
 	test-xcode-watchOS-debug \
-	test-xcode-watchOS-release
+	test-xcode-watchOS-release \
+	update-proto-files
 
 .NOTPARALLEL: \
 	test-xcode-iOS-debug \
@@ -252,7 +257,6 @@ test-all test-everything: test test-xcode
 test-runtime: build
 	${SWIFT} test
 
-
 #
 # Test the plugin by itself:
 #   * Translate every proto in Protos into Swift using local protoc-gen-swift
@@ -322,6 +326,28 @@ regenerate-test-protos: build
 		${GENERATE_SRCS} --tfiws_out=FileNaming=DropPath:Tests/SwiftProtobufTests $$t; \
 	done
 
+#
+# Helper to update the .proto files copied from the google/protobufs distro.
+#
+update-proto-files:
+	@if [ ! -d "${GOOGLE_PROTOBUFS_CHECKOUT}/src/google/protobuf" ]; then \
+	  echo "ERROR: ${GOOGLE_PROTOBUFS_CHECKOUT} does not appear to be a checkout of"; \
+	  echo "ERROR:   github.com/google/protobuf. Please check it out or set"; \
+	  echo "ERROR:   GOOGLE_PROTOBUFS_CHECKOUT to point to a checkout."; \
+	  exit 1; \
+	fi
+	@rm -rf Protos/conformance && mkdir Protos/conformance
+	@cp -v "${GOOGLE_PROTOBUFS_CHECKOUT}"/conformance/*.proto Protos/conformance/
+	@rm -rf Protos/google && mkdir -p Protos/google/protobuf/compiler
+	@cp -v "${GOOGLE_PROTOBUFS_CHECKOUT}"/src/google/protobuf/*.proto Protos/google/protobuf/
+	@cp -v "${GOOGLE_PROTOBUFS_CHECKOUT}"/src/google/protobuf/compiler/*.proto Protos/google/protobuf/compiler/
+	# It would be nice to get these added to google/protobuf instead of
+	# applying them locally.
+	@echo 'option swift_prefix = "Proto3";' >> Protos/google/protobuf/map_unittest_proto3.proto
+	@echo 'option swift_prefix = "Proto3";' >> Protos/google/protobuf/unittest_import_proto3.proto
+	@echo 'option swift_prefix = "Proto3";' >> Protos/google/protobuf/unittest_import_public_proto3.proto
+	@echo 'option swift_prefix = "Proto3";' >> Protos/google/protobuf/unittest_proto3.proto
+
 
 # Helpers to put the Xcode project through all modes.
 

+ 12 - 0
Protos/conformance/conformance.proto

@@ -210,6 +210,11 @@ message TestAllTypes {
     NestedMessage oneof_nested_message = 112;
     string oneof_string = 113;
     bytes oneof_bytes = 114;
+    bool oneof_bool = 115;
+    uint64 oneof_uint64 = 116;
+    float oneof_float = 117;
+    double oneof_double = 118;
+    NestedEnum oneof_enum = 119;
   }
 
   // Well-known types
@@ -248,6 +253,7 @@ message TestAllTypes {
   repeated google.protobuf.Value repeated_value = 316;
 
   // Test field-name-to-JSON-name convention.
+  // (protobuf says names can be any valid C/C++ identifier.)
   int32 fieldname1 = 401;
   int32 field_name2 = 402;
   int32 _field_name3 = 403;
@@ -260,6 +266,12 @@ message TestAllTypes {
   int32 Field_Name10 = 410;
   int32 FIELD_NAME11 = 411;
   int32 FIELD_name12 = 412;
+  int32 __field_name13 = 413;
+  int32 __Field_name14 = 414;
+  int32 field__name15 = 415;
+  int32 field__Name16 = 416;
+  int32 field_name17__ = 417;
+  int32 Field_name18__ = 418;
 }
 
 message ForeignMessage {

+ 0 - 1
Protos/google/protobuf/any.proto

@@ -37,7 +37,6 @@ option go_package = "github.com/golang/protobuf/ptypes/any";
 option java_package = "com.google.protobuf";
 option java_outer_classname = "AnyProto";
 option java_multiple_files = true;
-option java_generate_equals_and_hash = true;
 option objc_class_prefix = "GPB";
 
 // `Any` contains an arbitrary serialized protocol buffer message along with a

+ 1 - 1
Protos/google/protobuf/api.proto

@@ -39,8 +39,8 @@ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
 option java_package = "com.google.protobuf";
 option java_outer_classname = "ApiProto";
 option java_multiple_files = true;
-option java_generate_equals_and_hash = true;
 option objc_class_prefix = "GPB";
+option go_package = "google.golang.org/genproto/protobuf/api;api";
 
 // Api is a light-weight descriptor for a protocol buffer service.
 message Api {

+ 24 - 18
Protos/google/protobuf/descriptor.proto

@@ -157,7 +157,6 @@ message FieldDescriptorProto {
     LABEL_OPTIONAL      = 1;
     LABEL_REQUIRED      = 2;
     LABEL_REPEATED      = 3;
-    // TODO(sanjay): Should we add LABEL_MAP?
   };
 
   optional string name = 1;
@@ -305,19 +304,8 @@ message FileOptions {
   // top-level extensions defined in the file.
   optional bool java_multiple_files = 10 [default=false];
 
-  // If set true, then the Java code generator will generate equals() and
-  // hashCode() methods for all messages defined in the .proto file.
-  // This increases generated code size, potentially substantially for large
-  // protos, which may harm a memory-constrained application.
-  // - In the full runtime this is a speed optimization, as the
-  // AbstractMessage base class includes reflection-based implementations of
-  // these methods.
-  // - In the lite runtime, setting this option changes the semantics of
-  // equals() and hashCode() to more closely match those of the full runtime;
-  // the generated methods compute their results based on field values rather
-  // than object identity. (Implementations should not assume that hashcodes
-  // will be consistent across runtimes or versions of the protocol compiler.)
-  optional bool java_generate_equals_and_hash = 20 [default=false];
+  // This option does nothing.
+  optional bool java_generate_equals_and_hash = 20 [deprecated=true];
 
   // If set true, then the Java2 code generator will generate code that
   // throws an exception whenever an attempt is made to assign a non-UTF-8
@@ -378,8 +366,10 @@ message FileOptions {
   // Namespace for generated classes; defaults to the package.
   optional string csharp_namespace = 37;
 
-  // Prefix prepended to all Swift generated top-level types.
-  // Default is CamelCased package name.
+  // By default Swift generators will take the proto package and CamelCase it
+  // replacing '.' with underscore and use that to prefix the types/symbols
+  // defined. When this options is provided, they will use this value instead
+  // to prefix the types/symbols defined.
   optional string swift_prefix = 39;
 
   // The parser stores options it doesn't recognize here. See above.
@@ -446,6 +436,9 @@ message MessageOptions {
   // parser.
   optional bool map_entry = 7;
 
+  reserved 8;  // javalite_serializable
+
+
   // The parser stores options it doesn't recognize here. See above.
   repeated UninterpretedOption uninterpreted_option = 999;
 
@@ -474,7 +467,6 @@ message FieldOptions {
   // false will avoid using packed encoding.
   optional bool packed = 2;
 
-
   // The jstype option determines the JavaScript type used for values of the
   // field.  The option is permitted only for 64 bit integral and fixed types
   // (int64, uint64, sint64, fixed64, sfixed64).  By default these types are
@@ -515,7 +507,7 @@ message FieldOptions {
   //
   //
   // Note that implementations may choose not to check required fields within
-  // a lazy sub-message.  That is, calling IsInitialized() on the outher message
+  // a lazy sub-message.  That is, calling IsInitialized() on the outer message
   // may return true even if the inner message has missing required fields.
   // This is necessary because otherwise the inner message would have to be
   // parsed in order to perform the check, defeating the purpose of lazy
@@ -541,6 +533,8 @@ message FieldOptions {
 
   // Clients can define custom options in extensions of this message. See above.
   extensions 1000 to max;
+
+  reserved 4;  // removed jtype
 }
 
 message OneofOptions {
@@ -563,6 +557,7 @@ message EnumOptions {
   // is a formalization for deprecating enums.
   optional bool deprecated = 3 [default=false];
 
+
   // The parser stores options it doesn't recognize here. See above.
   repeated UninterpretedOption uninterpreted_option = 999;
 
@@ -617,6 +612,17 @@ message MethodOptions {
   // this is a formalization for deprecating methods.
   optional bool deprecated = 33 [default=false];
 
+  // Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
+  // or neither? HTTP based RPC implementation may choose GET verb for safe
+  // methods, and PUT verb for idempotent methods instead of the default POST.
+  enum IdempotencyLevel {
+    IDEMPOTENCY_UNKNOWN = 0;
+    NO_SIDE_EFFECTS     = 1; // implies idempotent
+    IDEMPOTENT          = 2; // idempotent, but may have side effects
+  }
+  optional IdempotencyLevel idempotency_level =
+      34 [default=IDEMPOTENCY_UNKNOWN];
+
   // The parser stores options it doesn't recognize here. See above.
   repeated UninterpretedOption uninterpreted_option = 999;
 

+ 8 - 1
Protos/google/protobuf/duration.proto

@@ -33,11 +33,11 @@ syntax = "proto3";
 package google.protobuf;
 
 option csharp_namespace = "Google.Protobuf.WellKnownTypes";
+option cc_enable_arenas = true;
 option go_package = "github.com/golang/protobuf/ptypes/duration";
 option java_package = "com.google.protobuf";
 option java_outer_classname = "DurationProto";
 option java_multiple_files = true;
-option java_generate_equals_and_hash = true;
 option objc_class_prefix = "GPB";
 
 // A Duration represents a signed, fixed-length span of time represented
@@ -81,8 +81,15 @@ option objc_class_prefix = "GPB";
 //       end.nanos -= 1000000000;
 //     }
 //
+// Example 3: Compute Duration from datetime.timedelta in Python.
+//
+//     td = datetime.timedelta(days=3, minutes=10)
+//     duration = Duration()
+//     duration.FromTimedelta(td)
+//
 //
 message Duration {
+
   // Signed seconds of the span of time. Must be from -315,576,000,000
   // to +315,576,000,000 inclusive.
   int64 seconds = 1;

+ 0 - 1
Protos/google/protobuf/empty.proto

@@ -37,7 +37,6 @@ option go_package = "github.com/golang/protobuf/ptypes/empty";
 option java_package = "com.google.protobuf";
 option java_outer_classname = "EmptyProto";
 option java_multiple_files = true;
-option java_generate_equals_and_hash = true;
 option objc_class_prefix = "GPB";
 option cc_enable_arenas = true;
 

+ 4 - 4
Protos/google/protobuf/field_mask.proto

@@ -37,7 +37,7 @@ option java_package = "com.google.protobuf";
 option java_outer_classname = "FieldMaskProto";
 option java_multiple_files = true;
 option objc_class_prefix = "GPB";
-option java_generate_equals_and_hash = true;
+option go_package = "google.golang.org/genproto/protobuf/field_mask;field_mask";
 
 // `FieldMask` represents a set of symbolic field paths, for example:
 //
@@ -82,7 +82,7 @@ option java_generate_equals_and_hash = true;
 //     }
 //
 // A repeated field is not allowed except at the last position of a
-// field mask.
+// paths string.
 //
 // If a FieldMask object is not present in a get operation, the
 // operation applies to all fields (as if a FieldMask of all fields
@@ -109,8 +109,8 @@ option java_generate_equals_and_hash = true;
 //
 // If a repeated field is specified for an update operation, the existing
 // repeated values in the target resource will be overwritten by the new values.
-// Note that a repeated field is only allowed in the last position of a field
-// mask.
+// Note that a repeated field is only allowed in the last position of a `paths`
+// string.
 //
 // If a sub-message is specified in the last position of the field mask for an
 // update operation, then the existing sub-message in the target resource is

+ 21 - 1
Protos/google/protobuf/map_proto2_unittest.proto

@@ -29,7 +29,7 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 syntax = "proto2";
-
+option cc_enable_arenas = true;
 
 import "google/protobuf/unittest_import.proto";
 
@@ -64,3 +64,23 @@ message TestEnumMapPlusExtra {
 message TestImportEnumMap {
   map<int32, protobuf_unittest_import.ImportEnumForMap> import_enum_amp = 1;
 }
+
+message TestIntIntMap {
+  map<int32, int32> m = 1;
+}
+
+// Test all key types: string, plus the non-floating-point scalars.
+message TestMaps {
+  map<int32, TestIntIntMap> m_int32 = 1;
+  map<int64, TestIntIntMap> m_int64 = 2;
+  map<uint32, TestIntIntMap> m_uint32 = 3;
+  map<uint64, TestIntIntMap> m_uint64 = 4;
+  map<sint32, TestIntIntMap> m_sint32 = 5;
+  map<sint64, TestIntIntMap> m_sint64 = 6;
+  map<fixed32, TestIntIntMap> m_fixed32 = 7;
+  map<fixed64, TestIntIntMap> m_fixed64 = 8;
+  map<sfixed32, TestIntIntMap> m_sfixed32 = 9;
+  map<sfixed64, TestIntIntMap> m_sfixed64 = 10;
+  map<bool, TestIntIntMap> m_bool = 11;
+  map<string, TestIntIntMap> m_string = 12;
+}

+ 1 - 4
Protos/google/protobuf/map_unittest_proto3.proto

@@ -39,10 +39,6 @@ syntax = "proto3";
 option cc_enable_arenas = true;
 option csharp_namespace = "Google.Protobuf.TestProtos";
 
-// Disambiguate from map_unittest.proto messages
-import "swift-options.proto";
-option (apple_swift_prefix) = "Proto3";
-
 import "google/protobuf/unittest_proto3.proto";
 
 // We don't put this in a package within proto2 because we need to make sure
@@ -122,3 +118,4 @@ message MessageContainingEnumCalledType {
 message MessageContainingMapCalledEntry {
   map<int32, int32> entry = 1;
 }
+option swift_prefix = "Proto3";

+ 1 - 1
Protos/google/protobuf/source_context.proto

@@ -36,8 +36,8 @@ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
 option java_package = "com.google.protobuf";
 option java_outer_classname = "SourceContextProto";
 option java_multiple_files = true;
-option java_generate_equals_and_hash = true;
 option objc_class_prefix = "GPB";
+option go_package = "google.golang.org/genproto/protobuf/source_context;source_context";
 
 // `SourceContext` represents information about the source of a
 // protobuf element, like the file in which it is defined.

+ 1 - 1
Protos/google/protobuf/struct.proto

@@ -33,11 +33,11 @@ syntax = "proto3";
 package google.protobuf;
 
 option csharp_namespace = "Google.Protobuf.WellKnownTypes";
+option cc_enable_arenas = true;
 option go_package = "github.com/golang/protobuf/ptypes/struct;structpb";
 option java_package = "com.google.protobuf";
 option java_outer_classname = "StructProto";
 option java_multiple_files = true;
-option java_generate_equals_and_hash = true;
 option objc_class_prefix = "GPB";
 
 

+ 3 - 6
Protos/google/protobuf/timestamp.proto

@@ -38,7 +38,6 @@ option go_package = "github.com/golang/protobuf/ptypes/timestamp";
 option java_package = "com.google.protobuf";
 option java_outer_classname = "TimestampProto";
 option java_multiple_files = true;
-option java_generate_equals_and_hash = true;
 option objc_class_prefix = "GPB";
 
 // A Timestamp represents a point in time independent of any time zone
@@ -90,16 +89,14 @@ option objc_class_prefix = "GPB";
 //
 // Example 5: Compute Timestamp from current time in Python.
 //
-//     now = time.time()
-//     seconds = int(now)
-//     nanos = int((now - seconds) * 10**9)
-//     timestamp = Timestamp(seconds=seconds, nanos=nanos)
+//     timestamp = Timestamp()
+//     timestamp.GetCurrentTime()
 //
 //
 message Timestamp {
 
   // Represents seconds of UTC time since Unix epoch
-  // 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to
+  // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
   // 9999-12-31T23:59:59Z inclusive.
   int64 seconds = 1;
 

+ 2 - 1
Protos/google/protobuf/type.proto

@@ -36,11 +36,12 @@ import "google/protobuf/any.proto";
 import "google/protobuf/source_context.proto";
 
 option csharp_namespace = "Google.Protobuf.WellKnownTypes";
+option cc_enable_arenas = true;
 option java_package = "com.google.protobuf";
 option java_outer_classname = "TypeProto";
 option java_multiple_files = true;
-option java_generate_equals_and_hash = true;
 option objc_class_prefix = "GPB";
+option go_package = "google.golang.org/genproto/protobuf/ptype;ptype";
 
 // A protocol buffer message type.
 message Type {

+ 39 - 0
Protos/google/protobuf/unittest.proto

@@ -878,3 +878,42 @@ service TestService {
 message BarRequest  {}
 message BarResponse {}
 
+message TestJsonName {
+  optional int32 field_name1 = 1;
+  optional int32 fieldName2 = 2;
+  optional int32 FieldName3 = 3;
+  optional int32 _field_name4 = 4;
+  optional int32 FIELD_NAME5 = 5;
+  optional int32 field_name6 = 6 [json_name = "@type"];
+}
+
+message TestHugeFieldNumbers {
+  optional int32 optional_int32 = 536870000;
+  optional int32 fixed_32 = 536870001;
+  repeated int32 repeated_int32 = 536870002 [packed = false];
+  repeated int32 packed_int32 = 536870003 [packed = true];
+
+  optional ForeignEnum optional_enum = 536870004;
+  optional string optional_string = 536870005;
+  optional bytes optional_bytes = 536870006;
+  optional ForeignMessage optional_message = 536870007;
+
+  optional group OptionalGroup = 536870008 {
+    optional int32 group_a = 536870009;
+  }
+
+  map<string, string> string_string_map = 536870010;
+
+  oneof oneof_field {
+    uint32 oneof_uint32 = 536870011;
+    TestAllTypes oneof_test_all_types = 536870012;
+    string oneof_string = 536870013;
+    bytes oneof_bytes = 536870014;
+  }
+
+  extensions  536860000 to 536869999;
+}
+
+extend TestHugeFieldNumbers {
+  optional TestAllTypes test_all_types = 536860000;
+}

+ 1 - 2
Protos/google/protobuf/unittest_import_proto3.proto

@@ -48,8 +48,6 @@ option cc_enable_arenas = true;
 // Exercise the java_package option.
 option java_package = "com.google.protobuf.test";
 option csharp_namespace = "Google.Protobuf.TestProtos";
-import "swift-options.proto";
-option (apple_swift_prefix) = "Proto3";
 
 // Do not set a java_outer_classname here to verify that Proto2 works without
 // one.
@@ -68,3 +66,4 @@ enum ImportEnum {
   IMPORT_BAZ = 9;
 }
 
+option swift_prefix = "Proto3";

+ 1 - 2
Protos/google/protobuf/unittest_import_public_proto3.proto

@@ -36,9 +36,8 @@ package protobuf_unittest_import;
 
 option java_package = "com.google.protobuf.test";
 option csharp_namespace = "Google.Protobuf.TestProtos";
-import "swift-options.proto";
-option (apple_swift_prefix) = "Proto3";
 
 message PublicImportMessage {
  int32 e = 1;
 }
+option swift_prefix = "Proto3";

+ 34 - 0
Protos/google/protobuf/unittest_lite.proto

@@ -163,6 +163,9 @@ message TestAllTypesLite {
     bytes oneof_bytes = 114;
     NestedMessage oneof_lazy_nested_message = 115 [lazy = true];
   }
+
+  // Tests toString for non-repeated fields with a list suffix
+  optional int32 deceptively_named_list = 116;
 }
 
 message ForeignMessageLite {
@@ -405,3 +408,34 @@ message V2MessageLite {
     required int32 int_field = 1;
     optional V2EnumLite enum_field = 2 [ default = V2_FIRST ];
 }
+
+message TestHugeFieldNumbersLite {
+  optional int32 optional_int32 = 536870000;
+  optional int32 fixed_32 = 536870001;
+  repeated int32 repeated_int32 = 536870002 [packed = false];
+  repeated int32 packed_int32 = 536870003 [packed = true];
+
+  optional ForeignEnumLite optional_enum = 536870004;
+  optional string optional_string = 536870005;
+  optional bytes optional_bytes = 536870006;
+  optional ForeignMessageLite optional_message = 536870007;
+
+  optional group OptionalGroup = 536870008 {
+    optional int32 group_a = 536870009;
+  }
+
+  map<string, string> string_string_map = 536870010;
+
+  oneof oneof_field {
+    uint32 oneof_uint32 = 536870011;
+    TestAllTypesLite oneof_test_all_types = 536870012;
+    string oneof_string = 536870013;
+    bytes oneof_bytes = 536870014;
+  }
+
+  extensions  536860000 to 536869999;
+}
+
+extend TestHugeFieldNumbersLite {
+  optional TestAllTypesLite test_all_types_lite = 536860000;
+}

+ 1 - 4
Protos/google/protobuf/unittest_proto3.proto

@@ -58,10 +58,6 @@ option optimize_for = SPEED;
 
 option java_outer_classname = "UnittestProto";
 
-// Disambiguate generated code from unittest.proto
-import "swift-options.proto";
-option (apple_swift_prefix) = "Proto3";
-
 // This proto includes every type of field in both singular and repeated
 // forms.
 message TestAllTypes {
@@ -390,3 +386,4 @@ service TestService {
 message BarRequest  {}
 message BarResponse {}
 
+option swift_prefix = "Proto3";

+ 0 - 1
Protos/google/protobuf/wrappers.proto

@@ -43,7 +43,6 @@ option go_package = "github.com/golang/protobuf/ptypes/wrappers";
 option java_package = "com.google.protobuf";
 option java_outer_classname = "WrappersProto";
 option java_multiple_files = true;
-option java_generate_equals_and_hash = true;
 option objc_class_prefix = "GPB";
 
 // Wrapper message for `double`.

+ 196 - 2
Reference/conformance/conformance.pb.swift

@@ -624,6 +624,11 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
     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"),
@@ -666,6 +671,12 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
     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 {
@@ -775,6 +786,12 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
     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() {}
 
@@ -842,7 +859,7 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
       case 72: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufString,Conformance_ForeignMessage>.self, value: &_mapStringForeignMessage)
       case 73: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufString,Conformance_TestAllTypes.NestedEnum>.self, value: &_mapStringNestedEnum)
       case 74: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufString,Conformance_ForeignEnum>.self, value: &_mapStringForeignEnum)
-      case 111, 112, 113, 114: try _oneofField.decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+      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)
@@ -885,6 +902,12 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
       case 410: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName10)
       case 411: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName11)
       case 412: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName12)
+      case 413: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &__FieldName13)
+      case 414: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &__FieldName14)
+      case 415: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_field_Name15)
+      case 416: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_field_Name16)
+      case 417: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName17__)
+      case 418: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName18__)
       default: break
       }
     }
@@ -1076,7 +1099,7 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
       if !_mapStringForeignEnum.isEmpty {
         try visitor.visitMapField(fieldType: ProtobufMap<ProtobufString,Conformance_ForeignEnum>.self, value: _mapStringForeignEnum, protoFieldNumber: 74)
       }
-      try _oneofField.traverse(visitor: &visitor, start: 111, end: 115)
+      try _oneofField.traverse(visitor: &visitor, start: 111, end: 120)
       if let v = _optionalBoolWrapper {
         try visitor.visitSingularMessageField(value: v, protoFieldNumber: 201)
       }
@@ -1203,6 +1226,24 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
       if _fieldName12 != 0 {
         try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: _fieldName12, protoFieldNumber: 412)
       }
+      if __FieldName13 != 0 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: __FieldName13, protoFieldNumber: 413)
+      }
+      if __FieldName14 != 0 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: __FieldName14, protoFieldNumber: 414)
+      }
+      if _field_Name15 != 0 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: _field_Name15, protoFieldNumber: 415)
+      }
+      if _field_Name16 != 0 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: _field_Name16, protoFieldNumber: 416)
+      }
+      if _fieldName17__ != 0 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: _fieldName17__, protoFieldNumber: 417)
+      }
+      if _fieldName18__ != 0 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: _fieldName18__, protoFieldNumber: 418)
+      }
     }
 
     func isEqualTo(other: _StorageClass) -> Bool {
@@ -1311,6 +1352,12 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
       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
     }
 
@@ -1421,6 +1468,12 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
       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
     }
   }
@@ -1433,6 +1486,11 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
     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: ()) {
@@ -1466,6 +1524,26 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
         var value = Data()
         try setter.decodeSingularField(fieldType: ProtobufBytes.self, value: &value)
         self = .oneofBytes(value)
+      case 115:
+        var value = Bool()
+        try setter.decodeSingularField(fieldType: ProtobufBool.self, value: &value)
+        self = .oneofBool(value)
+      case 116:
+        var value = UInt64()
+        try setter.decodeSingularField(fieldType: ProtobufUInt64.self, value: &value)
+        self = .oneofUint64(value)
+      case 117:
+        var value = Float()
+        try setter.decodeSingularField(fieldType: ProtobufFloat.self, value: &value)
+        self = .oneofFloat(value)
+      case 118:
+        var value = Double()
+        try setter.decodeSingularField(fieldType: 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
       }
@@ -1489,6 +1567,26 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
         if start <= 114 && 114 < end {
           try visitor.visitSingularField(fieldType: ProtobufBytes.self, value: v, protoFieldNumber: 114)
         }
+      case .oneofBool(let v):
+        if start <= 115 && 115 < end {
+          try visitor.visitSingularField(fieldType: ProtobufBool.self, value: v, protoFieldNumber: 115)
+        }
+      case .oneofUint64(let v):
+        if start <= 116 && 116 < end {
+          try visitor.visitSingularField(fieldType: ProtobufUInt64.self, value: v, protoFieldNumber: 116)
+        }
+      case .oneofFloat(let v):
+        if start <= 117 && 117 < end {
+          try visitor.visitSingularField(fieldType: ProtobufFloat.self, value: v, protoFieldNumber: 117)
+        }
+      case .oneofDouble(let v):
+        if start <= 118 && 118 < end {
+          try visitor.visitSingularField(fieldType: 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
       }
@@ -2056,6 +2154,66 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
     }
   }
 
+  var oneofBool: Bool {
+    get {
+      if case .oneofBool(let v) = _storage._oneofField {
+        return v
+      }
+      return false
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofBool(newValue)
+    }
+  }
+
+  var oneofUint64: UInt64 {
+    get {
+      if case .oneofUint64(let v) = _storage._oneofField {
+        return v
+      }
+      return 0
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofUint64(newValue)
+    }
+  }
+
+  var oneofFloat: Float {
+    get {
+      if case .oneofFloat(let v) = _storage._oneofField {
+        return v
+      }
+      return 0
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofFloat(newValue)
+    }
+  }
+
+  var oneofDouble: Double {
+    get {
+      if case .oneofDouble(let v) = _storage._oneofField {
+        return v
+      }
+      return 0
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofDouble(newValue)
+    }
+  }
+
+  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
   var optionalBoolWrapper: Google_Protobuf_BoolValue {
     get {return _storage._optionalBoolWrapper ?? Google_Protobuf_BoolValue()}
@@ -2298,6 +2456,7 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
   }
 
   ///   Test field-name-to-JSON-name convention.
+  ///   (protobuf says names can be any valid C/C++ identifier.)
   var fieldname1: Int32 {
     get {return _storage._fieldname1}
     set {_uniqueStorage()._fieldname1 = newValue}
@@ -2358,6 +2517,36 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
     set {_uniqueStorage()._fieldName12 = newValue}
   }
 
+  var _FieldName13: Int32 {
+    get {return _storage.__FieldName13}
+    set {_uniqueStorage().__FieldName13 = newValue}
+  }
+
+  var _FieldName14: Int32 {
+    get {return _storage.__FieldName14}
+    set {_uniqueStorage().__FieldName14 = newValue}
+  }
+
+  var field_Name15: Int32 {
+    get {return _storage._field_Name15}
+    set {_uniqueStorage()._field_Name15 = newValue}
+  }
+
+  var field_Name16: Int32 {
+    get {return _storage._field_Name16}
+    set {_uniqueStorage()._field_Name16 = newValue}
+  }
+
+  var fieldName17__: Int32 {
+    get {return _storage._fieldName17__}
+    set {_uniqueStorage()._fieldName17__ = newValue}
+  }
+
+  var fieldName18__: Int32 {
+    get {return _storage._fieldName18__}
+    set {_uniqueStorage()._fieldName18__ = newValue}
+  }
+
   public var oneofField: OneOf_OneofField {
     get {return _storage._oneofField}
     set {
@@ -2447,6 +2636,11 @@ func ==(lhs: Conformance_TestAllTypes.OneOf_OneofField, rhs: Conformance_TestAll
   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
   }

+ 112 - 18
Reference/google/protobuf/descriptor.pb.swift

@@ -1037,8 +1037,6 @@ struct Google_Protobuf_FieldDescriptorProto: ProtobufGeneratedMessage, ProtobufP
     ///   0 is reserved for errors
     case `optional` // = 1
     case `required` // = 2
-
-    ///   TODO(sanjay): Should we add LABEL_MAP?
     case repeated // = 3
 
     init() {
@@ -2102,18 +2100,7 @@ struct Google_Protobuf_FileOptions: ProtobufGeneratedMessage, ProtobufProto2Mess
     return _javaMultipleFiles = nil
   }
 
-  ///   If set true, then the Java code generator will generate equals() and
-  ///   hashCode() methods for all messages defined in the .proto file.
-  ///   This increases generated code size, potentially substantially for large
-  ///   protos, which may harm a memory-constrained application.
-  ///   - In the full runtime this is a speed optimization, as the
-  ///   AbstractMessage base class includes reflection-based implementations of
-  ///   these methods.
-  ///   - In the lite runtime, setting this option changes the semantics of
-  ///   equals() and hashCode() to more closely match those of the full runtime;
-  ///   the generated methods compute their results based on field values rather
-  ///   than object identity. (Implementations should not assume that hashcodes
-  ///   will be consistent across runtimes or versions of the protocol compiler.)
+  ///   This option does nothing.
   private var _javaGenerateEqualsAndHash: Bool? = nil
   var javaGenerateEqualsAndHash: Bool {
     get {return _javaGenerateEqualsAndHash ?? false}
@@ -2276,8 +2263,10 @@ struct Google_Protobuf_FileOptions: ProtobufGeneratedMessage, ProtobufProto2Mess
     return _csharpNamespace = nil
   }
 
-  ///   Prefix prepended to all Swift generated top-level types.
-  ///   Default is CamelCased package name.
+  ///   By default Swift generators will take the proto package and CamelCase it
+  ///   replacing '.' with underscore and use that to prefix the types/symbols
+  ///   defined. When this options is provided, they will use this value instead
+  ///   to prefix the types/symbols defined.
   private var _swiftPrefix: String? = nil
   var swiftPrefix: String {
     get {return _swiftPrefix ?? ""}
@@ -2376,7 +2365,7 @@ struct Google_Protobuf_FileOptions: ProtobufGeneratedMessage, ProtobufProto2Mess
     if (javaPackage != other.javaPackage) {return false}
     if (javaOuterClassname != other.javaOuterClassname) {return false}
     if (((_javaMultipleFiles != nil && _javaMultipleFiles! != false) || (other._javaMultipleFiles != nil && other._javaMultipleFiles! != false)) && (_javaMultipleFiles == nil || other._javaMultipleFiles == nil || _javaMultipleFiles! != other._javaMultipleFiles!)) {return false}
-    if (((_javaGenerateEqualsAndHash != nil && _javaGenerateEqualsAndHash! != false) || (other._javaGenerateEqualsAndHash != nil && other._javaGenerateEqualsAndHash! != false)) && (_javaGenerateEqualsAndHash == nil || other._javaGenerateEqualsAndHash == nil || _javaGenerateEqualsAndHash! != other._javaGenerateEqualsAndHash!)) {return false}
+    if (javaGenerateEqualsAndHash != other.javaGenerateEqualsAndHash) {return false}
     if (((_javaStringCheckUtf8 != nil && _javaStringCheckUtf8! != false) || (other._javaStringCheckUtf8 != nil && other._javaStringCheckUtf8! != false)) && (_javaStringCheckUtf8 == nil || other._javaStringCheckUtf8 == nil || _javaStringCheckUtf8! != other._javaStringCheckUtf8!)) {return false}
     if (((_optimizeFor != nil && _optimizeFor! != Google_Protobuf_FileOptions.OptimizeMode.speed) || (other._optimizeFor != nil && other._optimizeFor! != Google_Protobuf_FileOptions.OptimizeMode.speed)) && (_optimizeFor == nil || other._optimizeFor == nil || _optimizeFor! != other._optimizeFor!)) {return false}
     if (goPackage != other.goPackage) {return false}
@@ -2858,7 +2847,7 @@ struct Google_Protobuf_FieldOptions: ProtobufGeneratedMessage, ProtobufProto2Mes
   ///  
   ///  
   ///   Note that implementations may choose not to check required fields within
-  ///   a lazy sub-message.  That is, calling IsInitialized() on the outher message
+  ///   a lazy sub-message.  That is, calling IsInitialized() on the outer message
   ///   may return true even if the inner message has missing required fields.
   ///   This is necessary because otherwise the inner message would have to be
   ///   parsed in order to perform the check, defeating the purpose of lazy
@@ -3345,11 +3334,99 @@ struct Google_Protobuf_MethodOptions: ProtobufGeneratedMessage, ProtobufProto2Me
   public var protoPackageName: String {return "google.protobuf"}
   public static let _protobuf_fieldNames: FieldNameMap = [
     33: .same(proto: "deprecated", swift: "deprecated"),
+    34: .unique(proto: "idempotency_level", json: "idempotencyLevel", swift: "idempotencyLevel"),
     999: .unique(proto: "uninterpreted_option", json: "uninterpretedOption", swift: "uninterpretedOption"),
   ]
 
   public var unknown = ProtobufUnknownStorage()
 
+  ///   Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
+  ///   or neither? HTTP based RPC implementation may choose GET verb for safe
+  ///   methods, and PUT verb for idempotent methods instead of the default POST.
+  enum IdempotencyLevel: ProtobufEnum {
+    typealias RawValue = Int
+    case idempotencyUnknown // = 0
+
+    ///   implies idempotent
+    case noSideEffects // = 1
+
+    ///   idempotent, but may have side effects
+    case idempotent // = 2
+
+    init() {
+      self = .idempotencyUnknown
+    }
+
+    init?(rawValue: Int) {
+      switch rawValue {
+      case 0: self = .idempotencyUnknown
+      case 1: self = .noSideEffects
+      case 2: self = .idempotent
+      default: return nil
+      }
+    }
+
+    init?(name: String) {
+      switch name {
+      case "idempotencyUnknown": self = .idempotencyUnknown
+      case "noSideEffects": self = .noSideEffects
+      case "idempotent": self = .idempotent
+      default: return nil
+      }
+    }
+
+    init?(jsonName: String) {
+      switch jsonName {
+      case "IDEMPOTENCY_UNKNOWN": self = .idempotencyUnknown
+      case "NO_SIDE_EFFECTS": self = .noSideEffects
+      case "IDEMPOTENT": self = .idempotent
+      default: return nil
+      }
+    }
+
+    init?(protoName: String) {
+      switch protoName {
+      case "IDEMPOTENCY_UNKNOWN": self = .idempotencyUnknown
+      case "NO_SIDE_EFFECTS": self = .noSideEffects
+      case "IDEMPOTENT": self = .idempotent
+      default: return nil
+      }
+    }
+
+    var rawValue: Int {
+      get {
+        switch self {
+        case .idempotencyUnknown: return 0
+        case .noSideEffects: return 1
+        case .idempotent: return 2
+        }
+      }
+    }
+
+    var json: String {
+      get {
+        switch self {
+        case .idempotencyUnknown: return "\"IDEMPOTENCY_UNKNOWN\""
+        case .noSideEffects: return "\"NO_SIDE_EFFECTS\""
+        case .idempotent: return "\"IDEMPOTENT\""
+        }
+      }
+    }
+
+    var hashValue: Int { return rawValue }
+
+    var debugDescription: String {
+      get {
+        switch self {
+        case .idempotencyUnknown: return ".idempotencyUnknown"
+        case .noSideEffects: return ".noSideEffects"
+        case .idempotent: return ".idempotent"
+        }
+      }
+    }
+
+  }
+
   //  Note:  Field numbers 1 through 32 are reserved for Google's internal RPC
   //    framework.  We apologize for hoarding these numbers to ourselves, but
   //    we were already using them long before we decided to release Protocol
@@ -3371,6 +3448,18 @@ struct Google_Protobuf_MethodOptions: ProtobufGeneratedMessage, ProtobufProto2Me
     return _deprecated = nil
   }
 
+  private var _idempotencyLevel: Google_Protobuf_MethodOptions.IdempotencyLevel? = nil
+  var idempotencyLevel: Google_Protobuf_MethodOptions.IdempotencyLevel {
+    get {return _idempotencyLevel ?? Google_Protobuf_MethodOptions.IdempotencyLevel.idempotencyUnknown}
+    set {_idempotencyLevel = newValue}
+  }
+  public var hasIdempotencyLevel: Bool {
+    return _idempotencyLevel != nil
+  }
+  public mutating func clearIdempotencyLevel() {
+    return _idempotencyLevel = nil
+  }
+
   ///   The parser stores options it doesn't recognize here. See above.
   var uninterpretedOption: [Google_Protobuf_UninterpretedOption] = []
 
@@ -3379,6 +3468,7 @@ struct Google_Protobuf_MethodOptions: ProtobufGeneratedMessage, ProtobufProto2Me
   public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
     switch protoFieldNumber {
     case 33: try setter.decodeSingularField(fieldType: ProtobufBool.self, value: &_deprecated)
+    case 34: try setter.decodeSingularField(fieldType: Google_Protobuf_MethodOptions.IdempotencyLevel.self, value: &_idempotencyLevel)
     case 999: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_UninterpretedOption.self, value: &uninterpretedOption)
     default: if (1000 <= protoFieldNumber && protoFieldNumber < 536870912) {
         try setter.decodeExtensionField(values: &extensionFieldValues, messageType: Google_Protobuf_MethodOptions.self, protoFieldNumber: protoFieldNumber)
@@ -3390,6 +3480,9 @@ struct Google_Protobuf_MethodOptions: ProtobufGeneratedMessage, ProtobufProto2Me
     if let v = _deprecated {
       try visitor.visitSingularField(fieldType: ProtobufBool.self, value: v, protoFieldNumber: 33)
     }
+    if let v = _idempotencyLevel {
+      try visitor.visitSingularField(fieldType: Google_Protobuf_MethodOptions.IdempotencyLevel.self, value: v, protoFieldNumber: 34)
+    }
     if !uninterpretedOption.isEmpty {
       try visitor.visitRepeatedMessageField(value: uninterpretedOption, protoFieldNumber: 999)
     }
@@ -3399,6 +3492,7 @@ struct Google_Protobuf_MethodOptions: ProtobufGeneratedMessage, ProtobufProto2Me
 
   public func _protoc_generated_isEqualTo(other: Google_Protobuf_MethodOptions) -> Bool {
     if (((_deprecated != nil && _deprecated! != false) || (other._deprecated != nil && other._deprecated! != false)) && (_deprecated == nil || other._deprecated == nil || _deprecated! != other._deprecated!)) {return false}
+    if (((_idempotencyLevel != nil && _idempotencyLevel! != Google_Protobuf_MethodOptions.IdempotencyLevel.idempotencyUnknown) || (other._idempotencyLevel != nil && other._idempotencyLevel! != Google_Protobuf_MethodOptions.IdempotencyLevel.idempotencyUnknown)) && (_idempotencyLevel == nil || other._idempotencyLevel == nil || _idempotencyLevel! != other._idempotencyLevel!)) {return false}
     if uninterpretedOption != other.uninterpretedOption {return false}
     if unknown != other.unknown {return false}
     if extensionFieldValues != other.extensionFieldValues {return false}

+ 6 - 0
Reference/google/protobuf/duration.pb.swift

@@ -79,6 +79,12 @@ import Foundation
 ///         end.seconds += 1;
 ///         end.nanos -= 1000000000;
 ///       }
+///  
+///   Example 3: Compute Duration from datetime.timedelta in Python.
+///  
+///       td = datetime.timedelta(days=3, minutes=10)
+///       duration = Duration()
+///       duration.FromTimedelta(td)
 struct Google_Protobuf_Duration: ProtobufGeneratedMessage, ProtobufProto3Message, ProtoNameProviding {
   public var swiftClassName: String {return "Google_Protobuf_Duration"}
   public var protoMessageName: String {return "Duration"}

+ 3 - 3
Reference/google/protobuf/field_mask.pb.swift

@@ -82,7 +82,7 @@ import Foundation
 ///       }
 ///  
 ///   A repeated field is not allowed except at the last position of a
-///   field mask.
+///   paths string.
 ///  
 ///   If a FieldMask object is not present in a get operation, the
 ///   operation applies to all fields (as if a FieldMask of all fields
@@ -109,8 +109,8 @@ import Foundation
 ///  
 ///   If a repeated field is specified for an update operation, the existing
 ///   repeated values in the target resource will be overwritten by the new values.
-///   Note that a repeated field is only allowed in the last position of a field
-///   mask.
+///   Note that a repeated field is only allowed in the last position of a `paths`
+///   string.
 ///  
 ///   If a sub-message is specified in the last position of the field mask for an
 ///   update operation, then the existing sub-message in the target resource is

+ 159 - 0
Reference/google/protobuf/map_proto2_unittest.pb.swift

@@ -328,3 +328,162 @@ struct ProtobufUnittest_TestImportEnumMap: ProtobufGeneratedMessage, ProtobufPro
     return true
   }
 }
+
+struct ProtobufUnittest_TestIntIntMap: ProtobufGeneratedMessage, ProtobufProto2Message, ProtoNameProviding {
+  public var swiftClassName: String {return "ProtobufUnittest_TestIntIntMap"}
+  public var protoMessageName: String {return "TestIntIntMap"}
+  public var protoPackageName: String {return "protobuf_unittest"}
+  public static let _protobuf_fieldNames: FieldNameMap = [
+    1: .same(proto: "m", swift: "m"),
+  ]
+
+  public var unknown = ProtobufUnknownStorage()
+
+  var m: Dictionary<Int32,Int32> = [:]
+
+  init() {}
+
+  public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+    switch protoFieldNumber {
+    case 1: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufInt32,ProtobufInt32>.self, value: &m)
+    default: break
+    }
+  }
+
+  public func _protoc_generated_traverse(visitor: inout ProtobufVisitor) throws {
+    if !m.isEmpty {
+      try visitor.visitMapField(fieldType: ProtobufMap<ProtobufInt32,ProtobufInt32>.self, value: m, protoFieldNumber: 1)
+    }
+    unknown.traverse(visitor: &visitor)
+  }
+
+  public func _protoc_generated_isEqualTo(other: ProtobufUnittest_TestIntIntMap) -> Bool {
+    if m != other.m {return false}
+    if unknown != other.unknown {return false}
+    return true
+  }
+}
+
+///   Test all key types: string, plus the non-floating-point scalars.
+struct ProtobufUnittest_TestMaps: ProtobufGeneratedMessage, ProtobufProto2Message, ProtoNameProviding {
+  public var swiftClassName: String {return "ProtobufUnittest_TestMaps"}
+  public var protoMessageName: String {return "TestMaps"}
+  public var protoPackageName: String {return "protobuf_unittest"}
+  public static let _protobuf_fieldNames: FieldNameMap = [
+    1: .unique(proto: "m_int32", json: "mInt32", swift: "mInt32"),
+    2: .unique(proto: "m_int64", json: "mInt64", swift: "mInt64"),
+    3: .unique(proto: "m_uint32", json: "mUint32", swift: "mUint32"),
+    4: .unique(proto: "m_uint64", json: "mUint64", swift: "mUint64"),
+    5: .unique(proto: "m_sint32", json: "mSint32", swift: "mSint32"),
+    6: .unique(proto: "m_sint64", json: "mSint64", swift: "mSint64"),
+    7: .unique(proto: "m_fixed32", json: "mFixed32", swift: "mFixed32"),
+    8: .unique(proto: "m_fixed64", json: "mFixed64", swift: "mFixed64"),
+    9: .unique(proto: "m_sfixed32", json: "mSfixed32", swift: "mSfixed32"),
+    10: .unique(proto: "m_sfixed64", json: "mSfixed64", swift: "mSfixed64"),
+    11: .unique(proto: "m_bool", json: "mBool", swift: "mBool"),
+    12: .unique(proto: "m_string", json: "mString", swift: "mString"),
+  ]
+
+  public var unknown = ProtobufUnknownStorage()
+
+  var mInt32: Dictionary<Int32,ProtobufUnittest_TestIntIntMap> = [:]
+
+  var mInt64: Dictionary<Int64,ProtobufUnittest_TestIntIntMap> = [:]
+
+  var mUint32: Dictionary<UInt32,ProtobufUnittest_TestIntIntMap> = [:]
+
+  var mUint64: Dictionary<UInt64,ProtobufUnittest_TestIntIntMap> = [:]
+
+  var mSint32: Dictionary<Int32,ProtobufUnittest_TestIntIntMap> = [:]
+
+  var mSint64: Dictionary<Int64,ProtobufUnittest_TestIntIntMap> = [:]
+
+  var mFixed32: Dictionary<UInt32,ProtobufUnittest_TestIntIntMap> = [:]
+
+  var mFixed64: Dictionary<UInt64,ProtobufUnittest_TestIntIntMap> = [:]
+
+  var mSfixed32: Dictionary<Int32,ProtobufUnittest_TestIntIntMap> = [:]
+
+  var mSfixed64: Dictionary<Int64,ProtobufUnittest_TestIntIntMap> = [:]
+
+  var mBool: Dictionary<Bool,ProtobufUnittest_TestIntIntMap> = [:]
+
+  var mString: Dictionary<String,ProtobufUnittest_TestIntIntMap> = [:]
+
+  init() {}
+
+  public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+    switch protoFieldNumber {
+    case 1: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufInt32,ProtobufUnittest_TestIntIntMap>.self, value: &mInt32)
+    case 2: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufInt64,ProtobufUnittest_TestIntIntMap>.self, value: &mInt64)
+    case 3: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufUInt32,ProtobufUnittest_TestIntIntMap>.self, value: &mUint32)
+    case 4: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufUInt64,ProtobufUnittest_TestIntIntMap>.self, value: &mUint64)
+    case 5: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufSInt32,ProtobufUnittest_TestIntIntMap>.self, value: &mSint32)
+    case 6: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufSInt64,ProtobufUnittest_TestIntIntMap>.self, value: &mSint64)
+    case 7: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufFixed32,ProtobufUnittest_TestIntIntMap>.self, value: &mFixed32)
+    case 8: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufFixed64,ProtobufUnittest_TestIntIntMap>.self, value: &mFixed64)
+    case 9: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufSFixed32,ProtobufUnittest_TestIntIntMap>.self, value: &mSfixed32)
+    case 10: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufSFixed64,ProtobufUnittest_TestIntIntMap>.self, value: &mSfixed64)
+    case 11: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufBool,ProtobufUnittest_TestIntIntMap>.self, value: &mBool)
+    case 12: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufString,ProtobufUnittest_TestIntIntMap>.self, value: &mString)
+    default: break
+    }
+  }
+
+  public func _protoc_generated_traverse(visitor: inout ProtobufVisitor) throws {
+    if !mInt32.isEmpty {
+      try visitor.visitMapField(fieldType: ProtobufMap<ProtobufInt32,ProtobufUnittest_TestIntIntMap>.self, value: mInt32, protoFieldNumber: 1)
+    }
+    if !mInt64.isEmpty {
+      try visitor.visitMapField(fieldType: ProtobufMap<ProtobufInt64,ProtobufUnittest_TestIntIntMap>.self, value: mInt64, protoFieldNumber: 2)
+    }
+    if !mUint32.isEmpty {
+      try visitor.visitMapField(fieldType: ProtobufMap<ProtobufUInt32,ProtobufUnittest_TestIntIntMap>.self, value: mUint32, protoFieldNumber: 3)
+    }
+    if !mUint64.isEmpty {
+      try visitor.visitMapField(fieldType: ProtobufMap<ProtobufUInt64,ProtobufUnittest_TestIntIntMap>.self, value: mUint64, protoFieldNumber: 4)
+    }
+    if !mSint32.isEmpty {
+      try visitor.visitMapField(fieldType: ProtobufMap<ProtobufSInt32,ProtobufUnittest_TestIntIntMap>.self, value: mSint32, protoFieldNumber: 5)
+    }
+    if !mSint64.isEmpty {
+      try visitor.visitMapField(fieldType: ProtobufMap<ProtobufSInt64,ProtobufUnittest_TestIntIntMap>.self, value: mSint64, protoFieldNumber: 6)
+    }
+    if !mFixed32.isEmpty {
+      try visitor.visitMapField(fieldType: ProtobufMap<ProtobufFixed32,ProtobufUnittest_TestIntIntMap>.self, value: mFixed32, protoFieldNumber: 7)
+    }
+    if !mFixed64.isEmpty {
+      try visitor.visitMapField(fieldType: ProtobufMap<ProtobufFixed64,ProtobufUnittest_TestIntIntMap>.self, value: mFixed64, protoFieldNumber: 8)
+    }
+    if !mSfixed32.isEmpty {
+      try visitor.visitMapField(fieldType: ProtobufMap<ProtobufSFixed32,ProtobufUnittest_TestIntIntMap>.self, value: mSfixed32, protoFieldNumber: 9)
+    }
+    if !mSfixed64.isEmpty {
+      try visitor.visitMapField(fieldType: ProtobufMap<ProtobufSFixed64,ProtobufUnittest_TestIntIntMap>.self, value: mSfixed64, protoFieldNumber: 10)
+    }
+    if !mBool.isEmpty {
+      try visitor.visitMapField(fieldType: ProtobufMap<ProtobufBool,ProtobufUnittest_TestIntIntMap>.self, value: mBool, protoFieldNumber: 11)
+    }
+    if !mString.isEmpty {
+      try visitor.visitMapField(fieldType: ProtobufMap<ProtobufString,ProtobufUnittest_TestIntIntMap>.self, value: mString, protoFieldNumber: 12)
+    }
+    unknown.traverse(visitor: &visitor)
+  }
+
+  public func _protoc_generated_isEqualTo(other: ProtobufUnittest_TestMaps) -> Bool {
+    if mInt32 != other.mInt32 {return false}
+    if mInt64 != other.mInt64 {return false}
+    if mUint32 != other.mUint32 {return false}
+    if mUint64 != other.mUint64 {return false}
+    if mSint32 != other.mSint32 {return false}
+    if mSint64 != other.mSint64 {return false}
+    if mFixed32 != other.mFixed32 {return false}
+    if mFixed64 != other.mFixed64 {return false}
+    if mSfixed32 != other.mSfixed32 {return false}
+    if mSfixed64 != other.mSfixed64 {return false}
+    if mBool != other.mBool {return false}
+    if mString != other.mString {return false}
+    if unknown != other.unknown {return false}
+    return true
+  }
+}

+ 3 - 5
Reference/google/protobuf/timestamp.pb.swift

@@ -88,10 +88,8 @@ import Foundation
 ///  
 ///   Example 5: Compute Timestamp from current time in Python.
 ///  
-///       now = time.time()
-///       seconds = int(now)
-///       nanos = int((now - seconds) * 10**9)
-///       timestamp = Timestamp(seconds=seconds, nanos=nanos)
+///       timestamp = Timestamp()
+///       timestamp.GetCurrentTime()
 struct Google_Protobuf_Timestamp: ProtobufGeneratedMessage, ProtobufProto3Message, ProtoNameProviding {
   public var swiftClassName: String {return "Google_Protobuf_Timestamp"}
   public var protoMessageName: String {return "Timestamp"}
@@ -103,7 +101,7 @@ struct Google_Protobuf_Timestamp: ProtobufGeneratedMessage, ProtobufProto3Messag
 
 
   ///   Represents seconds of UTC time since Unix epoch
-  ///   1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to
+  ///   1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
   ///   9999-12-31T23:59:59Z inclusive.
   var seconds: Int64 = 0
 

+ 605 - 0
Reference/google/protobuf/unittest.pb.swift

@@ -8794,6 +8794,584 @@ struct ProtobufUnittest_BarResponse: ProtobufGeneratedMessage, ProtobufProto2Mes
   }
 }
 
+struct ProtobufUnittest_TestJsonName: ProtobufGeneratedMessage, ProtobufProto2Message, ProtoNameProviding {
+  public var swiftClassName: String {return "ProtobufUnittest_TestJsonName"}
+  public var protoMessageName: String {return "TestJsonName"}
+  public var protoPackageName: String {return "protobuf_unittest"}
+  public static let _protobuf_fieldNames: FieldNameMap = [
+    1: .unique(proto: "field_name1", json: "fieldName1", swift: "fieldName1"),
+    2: .same(proto: "fieldName2", swift: "fieldName2"),
+    3: .same(proto: "FieldName3", swift: "fieldName3"),
+    4: .unique(proto: "_field_name4", json: "FieldName4", swift: "fieldName4"),
+    5: .unique(proto: "FIELD_NAME5", json: "FIELDNAME5", swift: "fieldName5"),
+    6: .unique(proto: "field_name6", json: "@type", swift: "fieldName6"),
+  ]
+
+  public var unknown = ProtobufUnknownStorage()
+
+  private var _fieldName1: Int32? = nil
+  var fieldName1: Int32 {
+    get {return _fieldName1 ?? 0}
+    set {_fieldName1 = newValue}
+  }
+  public var hasFieldName1: Bool {
+    return _fieldName1 != nil
+  }
+  public mutating func clearFieldName1() {
+    return _fieldName1 = nil
+  }
+
+  private var _fieldName2: Int32? = nil
+  var fieldName2: Int32 {
+    get {return _fieldName2 ?? 0}
+    set {_fieldName2 = newValue}
+  }
+  public var hasFieldName2: Bool {
+    return _fieldName2 != nil
+  }
+  public mutating func clearFieldName2() {
+    return _fieldName2 = nil
+  }
+
+  private var _fieldName3: Int32? = nil
+  var fieldName3: Int32 {
+    get {return _fieldName3 ?? 0}
+    set {_fieldName3 = newValue}
+  }
+  public var hasFieldName3: Bool {
+    return _fieldName3 != nil
+  }
+  public mutating func clearFieldName3() {
+    return _fieldName3 = nil
+  }
+
+  private var _fieldName4: Int32? = nil
+  var fieldName4: Int32 {
+    get {return _fieldName4 ?? 0}
+    set {_fieldName4 = newValue}
+  }
+  public var hasFieldName4: Bool {
+    return _fieldName4 != nil
+  }
+  public mutating func clearFieldName4() {
+    return _fieldName4 = nil
+  }
+
+  private var _fieldName5: Int32? = nil
+  var fieldName5: Int32 {
+    get {return _fieldName5 ?? 0}
+    set {_fieldName5 = newValue}
+  }
+  public var hasFieldName5: Bool {
+    return _fieldName5 != nil
+  }
+  public mutating func clearFieldName5() {
+    return _fieldName5 = nil
+  }
+
+  private var _fieldName6: Int32? = nil
+  var fieldName6: Int32 {
+    get {return _fieldName6 ?? 0}
+    set {_fieldName6 = newValue}
+  }
+  public var hasFieldName6: Bool {
+    return _fieldName6 != nil
+  }
+  public mutating func clearFieldName6() {
+    return _fieldName6 = nil
+  }
+
+  init() {}
+
+  public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+    switch protoFieldNumber {
+    case 1: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName1)
+    case 2: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName2)
+    case 3: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName3)
+    case 4: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName4)
+    case 5: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName5)
+    case 6: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName6)
+    default: break
+    }
+  }
+
+  public func _protoc_generated_traverse(visitor: inout ProtobufVisitor) throws {
+    if let v = _fieldName1 {
+      try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 1)
+    }
+    if let v = _fieldName2 {
+      try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 2)
+    }
+    if let v = _fieldName3 {
+      try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 3)
+    }
+    if let v = _fieldName4 {
+      try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 4)
+    }
+    if let v = _fieldName5 {
+      try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 5)
+    }
+    if let v = _fieldName6 {
+      try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 6)
+    }
+    unknown.traverse(visitor: &visitor)
+  }
+
+  public func _protoc_generated_isEqualTo(other: ProtobufUnittest_TestJsonName) -> Bool {
+    if (fieldName1 != other.fieldName1) {return false}
+    if (fieldName2 != other.fieldName2) {return false}
+    if (fieldName3 != other.fieldName3) {return false}
+    if (fieldName4 != other.fieldName4) {return false}
+    if (fieldName5 != other.fieldName5) {return false}
+    if (fieldName6 != other.fieldName6) {return false}
+    if unknown != other.unknown {return false}
+    return true
+  }
+}
+
+struct ProtobufUnittest_TestHugeFieldNumbers: ProtobufGeneratedMessage, ProtobufProto2Message, ProtobufExtensibleMessage, ProtoNameProviding {
+  public var swiftClassName: String {return "ProtobufUnittest_TestHugeFieldNumbers"}
+  public var protoMessageName: String {return "TestHugeFieldNumbers"}
+  public var protoPackageName: String {return "protobuf_unittest"}
+  public static let _protobuf_fieldNames: FieldNameMap = [
+    536870000: .unique(proto: "optional_int32", json: "optionalInt32", swift: "optionalInt32"),
+    536870001: .unique(proto: "fixed_32", json: "fixed32", swift: "fixed32"),
+    536870002: .unique(proto: "repeated_int32", json: "repeatedInt32", swift: "repeatedInt32"),
+    536870003: .unique(proto: "packed_int32", json: "packedInt32", swift: "packedInt32"),
+    536870004: .unique(proto: "optional_enum", json: "optionalEnum", swift: "optionalEnum"),
+    536870005: .unique(proto: "optional_string", json: "optionalString", swift: "optionalString"),
+    536870006: .unique(proto: "optional_bytes", json: "optionalBytes", swift: "optionalBytes"),
+    536870007: .unique(proto: "optional_message", json: "optionalMessage", swift: "optionalMessage"),
+    536870008: .same(proto: "optionalgroup", swift: "optionalGroup"),
+    536870010: .unique(proto: "string_string_map", json: "stringStringMap", swift: "stringStringMap"),
+    536870011: .unique(proto: "oneof_uint32", json: "oneofUint32", swift: "oneofUint32"),
+    536870012: .unique(proto: "oneof_test_all_types", json: "oneofTestAllTypes", swift: "oneofTestAllTypes"),
+    536870013: .unique(proto: "oneof_string", json: "oneofString", swift: "oneofString"),
+    536870014: .unique(proto: "oneof_bytes", json: "oneofBytes", swift: "oneofBytes"),
+  ]
+
+  private class _StorageClass: ProtobufExtensibleMessageStorage {
+    typealias ProtobufExtendedMessage = ProtobufUnittest_TestHugeFieldNumbers
+    var extensionFieldValues = ProtobufExtensionFieldValueSet()
+    var unknown = ProtobufUnknownStorage()
+    var _optionalInt32: Int32? = nil
+    var _fixed32: Int32? = nil
+    var _repeatedInt32: [Int32] = []
+    var _packedInt32: [Int32] = []
+    var _optionalEnum: ProtobufUnittest_ForeignEnum? = nil
+    var _optionalString: String? = nil
+    var _optionalBytes: Data? = nil
+    var _optionalMessage: ProtobufUnittest_ForeignMessage? = nil
+    var _optionalGroup: ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup? = nil
+    var _stringStringMap: Dictionary<String,String> = [:]
+    var _oneofField = ProtobufUnittest_TestHugeFieldNumbers.OneOf_OneofField()
+
+    init() {}
+
+    func decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+      switch protoFieldNumber {
+      case 536870000: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_optionalInt32)
+      case 536870001: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fixed32)
+      case 536870002: try setter.decodeRepeatedField(fieldType: ProtobufInt32.self, value: &_repeatedInt32)
+      case 536870003: try setter.decodePackedField(fieldType: ProtobufInt32.self, value: &_packedInt32)
+      case 536870004: try setter.decodeSingularField(fieldType: ProtobufUnittest_ForeignEnum.self, value: &_optionalEnum)
+      case 536870005: try setter.decodeSingularField(fieldType: ProtobufString.self, value: &_optionalString)
+      case 536870006: try setter.decodeSingularField(fieldType: ProtobufBytes.self, value: &_optionalBytes)
+      case 536870007: try setter.decodeSingularMessageField(fieldType: ProtobufUnittest_ForeignMessage.self, value: &_optionalMessage)
+      case 536870008: try setter.decodeSingularGroupField(fieldType: ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup.self, value: &_optionalGroup)
+      case 536870010: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufString,ProtobufString>.self, value: &_stringStringMap)
+      case 536870011, 536870012, 536870013, 536870014: try _oneofField.decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+      default: if (536860000 <= protoFieldNumber && protoFieldNumber < 536870000) {
+          try setter.decodeExtensionField(values: &extensionFieldValues, messageType: ProtobufUnittest_TestHugeFieldNumbers.self, protoFieldNumber: protoFieldNumber)
+        }
+      }
+    }
+
+    func traverse(visitor: inout ProtobufVisitor) throws {
+      try extensionFieldValues.traverse(visitor: &visitor, start: 536860000, end: 536870000)
+      if let v = _optionalInt32 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 536870000)
+      }
+      if let v = _fixed32 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 536870001)
+      }
+      if !_repeatedInt32.isEmpty {
+        try visitor.visitRepeatedField(fieldType: ProtobufInt32.self, value: _repeatedInt32, protoFieldNumber: 536870002)
+      }
+      if !_packedInt32.isEmpty {
+        try visitor.visitPackedField(fieldType: ProtobufInt32.self, value: _packedInt32, protoFieldNumber: 536870003)
+      }
+      if let v = _optionalEnum {
+        try visitor.visitSingularField(fieldType: ProtobufUnittest_ForeignEnum.self, value: v, protoFieldNumber: 536870004)
+      }
+      if let v = _optionalString {
+        try visitor.visitSingularField(fieldType: ProtobufString.self, value: v, protoFieldNumber: 536870005)
+      }
+      if let v = _optionalBytes {
+        try visitor.visitSingularField(fieldType: ProtobufBytes.self, value: v, protoFieldNumber: 536870006)
+      }
+      if let v = _optionalMessage {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 536870007)
+      }
+      if let v = _optionalGroup {
+        try visitor.visitSingularGroupField(value: v, protoFieldNumber: 536870008)
+      }
+      if !_stringStringMap.isEmpty {
+        try visitor.visitMapField(fieldType: ProtobufMap<ProtobufString,ProtobufString>.self, value: _stringStringMap, protoFieldNumber: 536870010)
+      }
+      try _oneofField.traverse(visitor: &visitor, start: 536870011, end: 536870015)
+      unknown.traverse(visitor: &visitor)
+    }
+
+    func isEqualTo(other: _StorageClass) -> Bool {
+      if (_optionalInt32 != other._optionalInt32) {return false}
+      if (_fixed32 != other._fixed32) {return false}
+      if _repeatedInt32 != other._repeatedInt32 {return false}
+      if _packedInt32 != other._packedInt32 {return false}
+      if (_optionalEnum != other._optionalEnum) {return false}
+      if (_optionalString != other._optionalString) {return false}
+      if (_optionalBytes != other._optionalBytes) {return false}
+      if ((_optionalMessage != nil || other._optionalMessage != nil) && (_optionalMessage == nil || other._optionalMessage == nil || _optionalMessage! != other._optionalMessage!)) {return false}
+      if ((_optionalGroup != nil || other._optionalGroup != nil) && (_optionalGroup == nil || other._optionalGroup == nil || _optionalGroup! != other._optionalGroup!)) {return false}
+      if _stringStringMap != other._stringStringMap {return false}
+      if _oneofField != other._oneofField {return false}
+      if unknown != other.unknown {return false}
+      if extensionFieldValues != other.extensionFieldValues {return false}
+      return true
+    }
+
+    func copy() -> _StorageClass {
+      let clone = _StorageClass()
+      clone.unknown = unknown
+      clone.extensionFieldValues = extensionFieldValues
+      clone._optionalInt32 = _optionalInt32
+      clone._fixed32 = _fixed32
+      clone._repeatedInt32 = _repeatedInt32
+      clone._packedInt32 = _packedInt32
+      clone._optionalEnum = _optionalEnum
+      clone._optionalString = _optionalString
+      clone._optionalBytes = _optionalBytes
+      clone._optionalMessage = _optionalMessage
+      clone._optionalGroup = _optionalGroup
+      clone._stringStringMap = _stringStringMap
+      clone._oneofField = _oneofField
+      return clone
+    }
+  }
+
+  private var _storage = _StorageClass()
+
+  public var unknown: ProtobufUnknownStorage {
+    get {return _storage.unknown}
+    set {_storage.unknown = newValue}
+  }
+
+  enum OneOf_OneofField: ExpressibleByNilLiteral, ProtobufOneofEnum {
+    case oneofUint32(UInt32)
+    case oneofTestAllTypes(ProtobufUnittest_TestAllTypes)
+    case oneofString(String)
+    case oneofBytes(Data)
+    case None
+
+    public init(nilLiteral: ()) {
+      self = .None
+    }
+
+    public init() {
+      self = .None
+    }
+
+    public mutating func decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+      if self != .None && setter.rejectConflictingOneof {
+        throw ProtobufDecodingError.duplicatedOneOf
+      }
+      switch protoFieldNumber {
+      case 536870011:
+        var value: UInt32?
+        try setter.decodeSingularField(fieldType: ProtobufUInt32.self, value: &value)
+        if let value = value {
+          self = .oneofUint32(value)
+        }
+      case 536870012:
+        var value: ProtobufUnittest_TestAllTypes?
+        try setter.decodeSingularMessageField(fieldType: ProtobufUnittest_TestAllTypes.self, value: &value)
+        if let value = value {
+          self = .oneofTestAllTypes(value)
+        }
+      case 536870013:
+        var value: String?
+        try setter.decodeSingularField(fieldType: ProtobufString.self, value: &value)
+        if let value = value {
+          self = .oneofString(value)
+        }
+      case 536870014:
+        var value: Data?
+        try setter.decodeSingularField(fieldType: ProtobufBytes.self, value: &value)
+        if let value = value {
+          self = .oneofBytes(value)
+        }
+      default:
+        self = .None
+      }
+    }
+
+    public func traverse(visitor: inout ProtobufVisitor, start: Int, end: Int) throws {
+      switch self {
+      case .oneofUint32(let v):
+        if start <= 536870011 && 536870011 < end {
+          try visitor.visitSingularField(fieldType: ProtobufUInt32.self, value: v, protoFieldNumber: 536870011)
+        }
+      case .oneofTestAllTypes(let v):
+        if start <= 536870012 && 536870012 < end {
+          try visitor.visitSingularMessageField(value: v, protoFieldNumber: 536870012)
+        }
+      case .oneofString(let v):
+        if start <= 536870013 && 536870013 < end {
+          try visitor.visitSingularField(fieldType: ProtobufString.self, value: v, protoFieldNumber: 536870013)
+        }
+      case .oneofBytes(let v):
+        if start <= 536870014 && 536870014 < end {
+          try visitor.visitSingularField(fieldType: ProtobufBytes.self, value: v, protoFieldNumber: 536870014)
+        }
+      case .None:
+        break
+      }
+    }
+  }
+
+  struct OptionalGroup: ProtobufGeneratedMessage, ProtobufProto2Message, ProtoNameProviding {
+    public var swiftClassName: String {return "ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup"}
+    public var protoMessageName: String {return "OptionalGroup"}
+    public var protoPackageName: String {return "protobuf_unittest"}
+    public static let _protobuf_fieldNames: FieldNameMap = [
+      536870009: .unique(proto: "group_a", json: "groupA", swift: "groupA"),
+    ]
+
+    public var unknown = ProtobufUnknownStorage()
+
+    private var _groupA: Int32? = nil
+    var groupA: Int32 {
+      get {return _groupA ?? 0}
+      set {_groupA = newValue}
+    }
+    public var hasGroupA: Bool {
+      return _groupA != nil
+    }
+    public mutating func clearGroupA() {
+      return _groupA = nil
+    }
+
+    init() {}
+
+    public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+      switch protoFieldNumber {
+      case 536870009: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_groupA)
+      default: break
+      }
+    }
+
+    public func _protoc_generated_traverse(visitor: inout ProtobufVisitor) throws {
+      if let v = _groupA {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 536870009)
+      }
+      unknown.traverse(visitor: &visitor)
+    }
+
+    public func _protoc_generated_isEqualTo(other: ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup) -> Bool {
+      if (groupA != other.groupA) {return false}
+      if unknown != other.unknown {return false}
+      return true
+    }
+  }
+
+  var optionalInt32: Int32 {
+    get {return _storage._optionalInt32 ?? 0}
+    set {_uniqueStorage()._optionalInt32 = newValue}
+  }
+  public var hasOptionalInt32: Bool {
+    return _storage._optionalInt32 != nil
+  }
+  public mutating func clearOptionalInt32() {
+    return _storage._optionalInt32 = nil
+  }
+
+  var fixed32: Int32 {
+    get {return _storage._fixed32 ?? 0}
+    set {_uniqueStorage()._fixed32 = newValue}
+  }
+  public var hasFixed32: Bool {
+    return _storage._fixed32 != nil
+  }
+  public mutating func clearFixed32() {
+    return _storage._fixed32 = nil
+  }
+
+  var repeatedInt32: [Int32] {
+    get {return _storage._repeatedInt32}
+    set {_uniqueStorage()._repeatedInt32 = newValue}
+  }
+
+  var packedInt32: [Int32] {
+    get {return _storage._packedInt32}
+    set {_uniqueStorage()._packedInt32 = newValue}
+  }
+
+  var optionalEnum: ProtobufUnittest_ForeignEnum {
+    get {return _storage._optionalEnum ?? ProtobufUnittest_ForeignEnum.foreignFoo}
+    set {_uniqueStorage()._optionalEnum = newValue}
+  }
+  public var hasOptionalEnum: Bool {
+    return _storage._optionalEnum != nil
+  }
+  public mutating func clearOptionalEnum() {
+    return _storage._optionalEnum = nil
+  }
+
+  var optionalString: String {
+    get {return _storage._optionalString ?? ""}
+    set {_uniqueStorage()._optionalString = newValue}
+  }
+  public var hasOptionalString: Bool {
+    return _storage._optionalString != nil
+  }
+  public mutating func clearOptionalString() {
+    return _storage._optionalString = nil
+  }
+
+  var optionalBytes: Data {
+    get {return _storage._optionalBytes ?? Data()}
+    set {_uniqueStorage()._optionalBytes = newValue}
+  }
+  public var hasOptionalBytes: Bool {
+    return _storage._optionalBytes != nil
+  }
+  public mutating func clearOptionalBytes() {
+    return _storage._optionalBytes = nil
+  }
+
+  var optionalMessage: ProtobufUnittest_ForeignMessage {
+    get {return _storage._optionalMessage ?? ProtobufUnittest_ForeignMessage()}
+    set {_uniqueStorage()._optionalMessage = newValue}
+  }
+  public var hasOptionalMessage: Bool {
+    return _storage._optionalMessage != nil
+  }
+  public mutating func clearOptionalMessage() {
+    return _storage._optionalMessage = nil
+  }
+
+  var optionalGroup: ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup {
+    get {return _storage._optionalGroup ?? ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup()}
+    set {_uniqueStorage()._optionalGroup = newValue}
+  }
+  public var hasOptionalGroup: Bool {
+    return _storage._optionalGroup != nil
+  }
+  public mutating func clearOptionalGroup() {
+    return _storage._optionalGroup = nil
+  }
+
+  var stringStringMap: Dictionary<String,String> {
+    get {return _storage._stringStringMap}
+    set {_uniqueStorage()._stringStringMap = newValue}
+  }
+
+  var oneofUint32: UInt32 {
+    get {
+      if case .oneofUint32(let v) = _storage._oneofField {
+        return v
+      }
+      return 0
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofUint32(newValue)
+    }
+  }
+
+  var oneofTestAllTypes: ProtobufUnittest_TestAllTypes {
+    get {
+      if case .oneofTestAllTypes(let v) = _storage._oneofField {
+        return v
+      }
+      return ProtobufUnittest_TestAllTypes()
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofTestAllTypes(newValue)
+    }
+  }
+
+  var oneofString: String {
+    get {
+      if case .oneofString(let v) = _storage._oneofField {
+        return v
+      }
+      return ""
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofString(newValue)
+    }
+  }
+
+  var oneofBytes: Data {
+    get {
+      if case .oneofBytes(let v) = _storage._oneofField {
+        return v
+      }
+      return Data()
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofBytes(newValue)
+    }
+  }
+
+  public var oneofField: OneOf_OneofField {
+    get {return _storage._oneofField}
+    set {
+      _uniqueStorage()._oneofField = newValue
+    }
+  }
+
+  init() {}
+
+  public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+    try _uniqueStorage().decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+  }
+
+  public func _protoc_generated_traverse(visitor: inout ProtobufVisitor) throws {
+    try _storage.traverse(visitor: &visitor)
+  }
+
+  public func _protoc_generated_isEqualTo(other: ProtobufUnittest_TestHugeFieldNumbers) -> Bool {
+    return _storage === other._storage || _storage.isEqualTo(other: other._storage)
+  }
+
+  private mutating func _uniqueStorage() -> _StorageClass {
+    if !isKnownUniquelyReferenced(&_storage) {
+      _storage = _storage.copy()
+    }
+    return _storage
+  }
+
+  public mutating func setExtensionValue<F: ProtobufExtensionField>(ext: ProtobufGenericMessageExtension<F, ProtobufUnittest_TestHugeFieldNumbers>, value: F.ValueType) {
+    return _uniqueStorage().setExtensionValue(ext: ext, value: value)
+  }
+
+  public mutating func clearExtensionValue<F: ProtobufExtensionField>(ext: ProtobufGenericMessageExtension<F, ProtobufUnittest_TestHugeFieldNumbers>) {
+    return _storage.clearExtensionValue(ext: ext)
+  }
+
+  public func getExtensionValue<F: ProtobufExtensionField>(ext: ProtobufGenericMessageExtension<F, ProtobufUnittest_TestHugeFieldNumbers>) -> F.ValueType {
+    return _storage.getExtensionValue(ext: ext)
+  }
+
+  public func hasExtensionValue<F: ProtobufExtensionField>(ext: ProtobufGenericMessageExtension<F, ProtobufUnittest_TestHugeFieldNumbers>) -> Bool {
+    return _storage.hasExtensionValue(ext: ext)
+  }
+  public func _protobuf_fieldNames(for number: Int) -> FieldNameMap.Names? {
+    return ProtobufUnittest_TestHugeFieldNumbers._protobuf_fieldNames.fieldNames(for: number) ?? _storage.extensionFieldValues.fieldNames(for: number)
+  }
+}
+
 ///   Singular
 let ProtobufUnittest_Extensions_optionalInt32Extension = ProtobufGenericMessageExtension<ProtobufOptionalField<ProtobufInt32>, ProtobufUnittest_TestAllExtensions>(protoFieldNumber: 1, fieldNames: .unique(proto: "optional_int32_extension", json: "optionalInt32Extension", swift: "ProtobufUnittest_optionalInt32Extension"), defaultValue: 0)
 
@@ -9008,6 +9586,8 @@ let ProtobufUnittest_Extensions_unpackedBoolExtension = ProtobufGenericMessageEx
 
 let ProtobufUnittest_Extensions_unpackedEnumExtension = ProtobufGenericMessageExtension<ProtobufRepeatedField<ProtobufUnittest_ForeignEnum>, ProtobufUnittest_TestUnpackedExtensions>(protoFieldNumber: 103, fieldNames: .unique(proto: "unpacked_enum_extension", json: "unpackedEnumExtension", swift: "ProtobufUnittest_unpackedEnumExtension"), defaultValue: [])
 
+let ProtobufUnittest_Extensions_testAllTypes = ProtobufGenericMessageExtension<ProtobufOptionalMessageField<ProtobufUnittest_TestAllTypes>, ProtobufUnittest_TestHugeFieldNumbers>(protoFieldNumber: 536860000, fieldNames: .unique(proto: "test_all_types", json: "testAllTypes", swift: "ProtobufUnittest_testAllTypes"), defaultValue: ProtobufUnittest_TestAllTypes())
+
 func ==(lhs: ProtobufUnittest_TestAllTypes.OneOf_OneofField, rhs: ProtobufUnittest_TestAllTypes.OneOf_OneofField) -> Bool {
   switch (lhs, rhs) {
   case (.oneofUint32(let l), .oneofUint32(let r)): return l == r
@@ -9151,6 +9731,17 @@ extension ProtobufUnittest_TestParsingMerge {
   }
 }
 
+func ==(lhs: ProtobufUnittest_TestHugeFieldNumbers.OneOf_OneofField, rhs: ProtobufUnittest_TestHugeFieldNumbers.OneOf_OneofField) -> Bool {
+  switch (lhs, rhs) {
+  case (.oneofUint32(let l), .oneofUint32(let r)): return l == r
+  case (.oneofTestAllTypes(let l), .oneofTestAllTypes(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 (.None, .None): return true
+  default: return false
+  }
+}
+
 extension ProtobufUnittest_TestAllExtensions {
   ///   Singular
   var ProtobufUnittest_optionalInt32Extension: Int32 {
@@ -10520,6 +11111,19 @@ extension ProtobufUnittest_TestUnpackedExtensions {
   }
 }
 
+extension ProtobufUnittest_TestHugeFieldNumbers {
+  var ProtobufUnittest_testAllTypes: ProtobufUnittest_TestAllTypes {
+    get {return getExtensionValue(ext: ProtobufUnittest_Extensions_testAllTypes) ?? ProtobufUnittest_TestAllTypes()}
+    set {setExtensionValue(ext: ProtobufUnittest_Extensions_testAllTypes, value: newValue)}
+  }
+  var hasProtobufUnittest_testAllTypes: Bool {
+    return hasExtensionValue(ext: ProtobufUnittest_Extensions_testAllTypes)
+  }
+  mutating func clearProtobufUnittest_testAllTypes() {
+    clearExtensionValue(ext: ProtobufUnittest_Extensions_testAllTypes)
+  }
+}
+
 let ProtobufUnittest_Unittest_Extensions: ProtobufExtensionSet = [
   ProtobufUnittest_Extensions_optionalInt32Extension,
   ProtobufUnittest_Extensions_optionalInt64Extension,
@@ -10626,6 +11230,7 @@ let ProtobufUnittest_Unittest_Extensions: ProtobufExtensionSet = [
   ProtobufUnittest_Extensions_unpackedDoubleExtension,
   ProtobufUnittest_Extensions_unpackedBoolExtension,
   ProtobufUnittest_Extensions_unpackedEnumExtension,
+  ProtobufUnittest_Extensions_testAllTypes,
   ProtobufUnittest_TestNestedExtension.Extensions.test,
   ProtobufUnittest_TestNestedExtension.Extensions.nestedStringExtension,
   ProtobufUnittest_TestRequired.Extensions.single,

+ 490 - 0
Reference/google/protobuf/unittest_lite.pb.swift

@@ -342,6 +342,7 @@ struct ProtobufUnittest_TestAllTypesLite: ProtobufGeneratedMessage, ProtobufProt
     113: .unique(proto: "oneof_string", json: "oneofString", swift: "oneofString"),
     114: .unique(proto: "oneof_bytes", json: "oneofBytes", swift: "oneofBytes"),
     115: .unique(proto: "oneof_lazy_nested_message", json: "oneofLazyNestedMessage", swift: "oneofLazyNestedMessage"),
+    116: .unique(proto: "deceptively_named_list", json: "deceptivelyNamedList", swift: "deceptivelyNamedList"),
   ]
 
   private class _StorageClass {
@@ -419,6 +420,7 @@ struct ProtobufUnittest_TestAllTypesLite: ProtobufGeneratedMessage, ProtobufProt
     var _defaultStringPiece: String? = nil
     var _defaultCord: String? = nil
     var _oneofField = ProtobufUnittest_TestAllTypesLite.OneOf_OneofField()
+    var _deceptivelyNamedList: Int32? = nil
 
     init() {}
 
@@ -496,6 +498,7 @@ struct ProtobufUnittest_TestAllTypesLite: ProtobufGeneratedMessage, ProtobufProt
       case 84: try setter.decodeSingularField(fieldType: ProtobufString.self, value: &_defaultStringPiece)
       case 85: try setter.decodeSingularField(fieldType: ProtobufString.self, value: &_defaultCord)
       case 111, 112, 113, 114, 115: try _oneofField.decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+      case 116: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_deceptivelyNamedList)
       default: break
       }
     }
@@ -715,6 +718,9 @@ struct ProtobufUnittest_TestAllTypesLite: ProtobufGeneratedMessage, ProtobufProt
         try visitor.visitSingularField(fieldType: ProtobufString.self, value: v, protoFieldNumber: 85)
       }
       try _oneofField.traverse(visitor: &visitor, start: 111, end: 116)
+      if let v = _deceptivelyNamedList {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 116)
+      }
       unknown.traverse(visitor: &visitor)
     }
 
@@ -791,6 +797,7 @@ struct ProtobufUnittest_TestAllTypesLite: ProtobufGeneratedMessage, ProtobufProt
       if (((_defaultStringPiece != nil && _defaultStringPiece! != "abc") || (other._defaultStringPiece != nil && other._defaultStringPiece! != "abc")) && (_defaultStringPiece == nil || other._defaultStringPiece == nil || _defaultStringPiece! != other._defaultStringPiece!)) {return false}
       if (((_defaultCord != nil && _defaultCord! != "123") || (other._defaultCord != nil && other._defaultCord! != "123")) && (_defaultCord == nil || other._defaultCord == nil || _defaultCord! != other._defaultCord!)) {return false}
       if _oneofField != other._oneofField {return false}
+      if (_deceptivelyNamedList != other._deceptivelyNamedList) {return false}
       if unknown != other.unknown {return false}
       return true
     }
@@ -870,6 +877,7 @@ struct ProtobufUnittest_TestAllTypesLite: ProtobufGeneratedMessage, ProtobufProt
       clone._defaultStringPiece = _defaultStringPiece
       clone._defaultCord = _defaultCord
       clone._oneofField = _oneofField
+      clone._deceptivelyNamedList = _deceptivelyNamedList
       return clone
     }
   }
@@ -1893,6 +1901,18 @@ struct ProtobufUnittest_TestAllTypesLite: ProtobufGeneratedMessage, ProtobufProt
     }
   }
 
+  ///   Tests toString for non-repeated fields with a list suffix
+  var deceptivelyNamedList: Int32 {
+    get {return _storage._deceptivelyNamedList ?? 0}
+    set {_uniqueStorage()._deceptivelyNamedList = newValue}
+  }
+  public var hasDeceptivelyNamedList: Bool {
+    return _storage._deceptivelyNamedList != nil
+  }
+  public mutating func clearDeceptivelyNamedList() {
+    return _storage._deceptivelyNamedList = nil
+  }
+
   public var oneofField: OneOf_OneofField {
     get {return _storage._oneofField}
     set {
@@ -3170,6 +3190,449 @@ struct ProtobufUnittest_V2MessageLite: ProtobufGeneratedMessage, ProtobufProto2M
   }
 }
 
+struct ProtobufUnittest_TestHugeFieldNumbersLite: ProtobufGeneratedMessage, ProtobufProto2Message, ProtobufExtensibleMessage, ProtoNameProviding {
+  public var swiftClassName: String {return "ProtobufUnittest_TestHugeFieldNumbersLite"}
+  public var protoMessageName: String {return "TestHugeFieldNumbersLite"}
+  public var protoPackageName: String {return "protobuf_unittest"}
+  public static let _protobuf_fieldNames: FieldNameMap = [
+    536870000: .unique(proto: "optional_int32", json: "optionalInt32", swift: "optionalInt32"),
+    536870001: .unique(proto: "fixed_32", json: "fixed32", swift: "fixed32"),
+    536870002: .unique(proto: "repeated_int32", json: "repeatedInt32", swift: "repeatedInt32"),
+    536870003: .unique(proto: "packed_int32", json: "packedInt32", swift: "packedInt32"),
+    536870004: .unique(proto: "optional_enum", json: "optionalEnum", swift: "optionalEnum"),
+    536870005: .unique(proto: "optional_string", json: "optionalString", swift: "optionalString"),
+    536870006: .unique(proto: "optional_bytes", json: "optionalBytes", swift: "optionalBytes"),
+    536870007: .unique(proto: "optional_message", json: "optionalMessage", swift: "optionalMessage"),
+    536870008: .same(proto: "optionalgroup", swift: "optionalGroup"),
+    536870010: .unique(proto: "string_string_map", json: "stringStringMap", swift: "stringStringMap"),
+    536870011: .unique(proto: "oneof_uint32", json: "oneofUint32", swift: "oneofUint32"),
+    536870012: .unique(proto: "oneof_test_all_types", json: "oneofTestAllTypes", swift: "oneofTestAllTypes"),
+    536870013: .unique(proto: "oneof_string", json: "oneofString", swift: "oneofString"),
+    536870014: .unique(proto: "oneof_bytes", json: "oneofBytes", swift: "oneofBytes"),
+  ]
+
+  private class _StorageClass: ProtobufExtensibleMessageStorage {
+    typealias ProtobufExtendedMessage = ProtobufUnittest_TestHugeFieldNumbersLite
+    var extensionFieldValues = ProtobufExtensionFieldValueSet()
+    var unknown = ProtobufUnknownStorage()
+    var _optionalInt32: Int32? = nil
+    var _fixed32: Int32? = nil
+    var _repeatedInt32: [Int32] = []
+    var _packedInt32: [Int32] = []
+    var _optionalEnum: ProtobufUnittest_ForeignEnumLite? = nil
+    var _optionalString: String? = nil
+    var _optionalBytes: Data? = nil
+    var _optionalMessage: ProtobufUnittest_ForeignMessageLite? = nil
+    var _optionalGroup: ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup? = nil
+    var _stringStringMap: Dictionary<String,String> = [:]
+    var _oneofField = ProtobufUnittest_TestHugeFieldNumbersLite.OneOf_OneofField()
+
+    init() {}
+
+    func decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+      switch protoFieldNumber {
+      case 536870000: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_optionalInt32)
+      case 536870001: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fixed32)
+      case 536870002: try setter.decodeRepeatedField(fieldType: ProtobufInt32.self, value: &_repeatedInt32)
+      case 536870003: try setter.decodePackedField(fieldType: ProtobufInt32.self, value: &_packedInt32)
+      case 536870004: try setter.decodeSingularField(fieldType: ProtobufUnittest_ForeignEnumLite.self, value: &_optionalEnum)
+      case 536870005: try setter.decodeSingularField(fieldType: ProtobufString.self, value: &_optionalString)
+      case 536870006: try setter.decodeSingularField(fieldType: ProtobufBytes.self, value: &_optionalBytes)
+      case 536870007: try setter.decodeSingularMessageField(fieldType: ProtobufUnittest_ForeignMessageLite.self, value: &_optionalMessage)
+      case 536870008: try setter.decodeSingularGroupField(fieldType: ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup.self, value: &_optionalGroup)
+      case 536870010: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufString,ProtobufString>.self, value: &_stringStringMap)
+      case 536870011, 536870012, 536870013, 536870014: try _oneofField.decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+      default: if (536860000 <= protoFieldNumber && protoFieldNumber < 536870000) {
+          try setter.decodeExtensionField(values: &extensionFieldValues, messageType: ProtobufUnittest_TestHugeFieldNumbersLite.self, protoFieldNumber: protoFieldNumber)
+        }
+      }
+    }
+
+    func traverse(visitor: inout ProtobufVisitor) throws {
+      try extensionFieldValues.traverse(visitor: &visitor, start: 536860000, end: 536870000)
+      if let v = _optionalInt32 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 536870000)
+      }
+      if let v = _fixed32 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 536870001)
+      }
+      if !_repeatedInt32.isEmpty {
+        try visitor.visitRepeatedField(fieldType: ProtobufInt32.self, value: _repeatedInt32, protoFieldNumber: 536870002)
+      }
+      if !_packedInt32.isEmpty {
+        try visitor.visitPackedField(fieldType: ProtobufInt32.self, value: _packedInt32, protoFieldNumber: 536870003)
+      }
+      if let v = _optionalEnum {
+        try visitor.visitSingularField(fieldType: ProtobufUnittest_ForeignEnumLite.self, value: v, protoFieldNumber: 536870004)
+      }
+      if let v = _optionalString {
+        try visitor.visitSingularField(fieldType: ProtobufString.self, value: v, protoFieldNumber: 536870005)
+      }
+      if let v = _optionalBytes {
+        try visitor.visitSingularField(fieldType: ProtobufBytes.self, value: v, protoFieldNumber: 536870006)
+      }
+      if let v = _optionalMessage {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 536870007)
+      }
+      if let v = _optionalGroup {
+        try visitor.visitSingularGroupField(value: v, protoFieldNumber: 536870008)
+      }
+      if !_stringStringMap.isEmpty {
+        try visitor.visitMapField(fieldType: ProtobufMap<ProtobufString,ProtobufString>.self, value: _stringStringMap, protoFieldNumber: 536870010)
+      }
+      try _oneofField.traverse(visitor: &visitor, start: 536870011, end: 536870015)
+      unknown.traverse(visitor: &visitor)
+    }
+
+    func isEqualTo(other: _StorageClass) -> Bool {
+      if (_optionalInt32 != other._optionalInt32) {return false}
+      if (_fixed32 != other._fixed32) {return false}
+      if _repeatedInt32 != other._repeatedInt32 {return false}
+      if _packedInt32 != other._packedInt32 {return false}
+      if (_optionalEnum != other._optionalEnum) {return false}
+      if (_optionalString != other._optionalString) {return false}
+      if (_optionalBytes != other._optionalBytes) {return false}
+      if ((_optionalMessage != nil || other._optionalMessage != nil) && (_optionalMessage == nil || other._optionalMessage == nil || _optionalMessage! != other._optionalMessage!)) {return false}
+      if ((_optionalGroup != nil || other._optionalGroup != nil) && (_optionalGroup == nil || other._optionalGroup == nil || _optionalGroup! != other._optionalGroup!)) {return false}
+      if _stringStringMap != other._stringStringMap {return false}
+      if _oneofField != other._oneofField {return false}
+      if unknown != other.unknown {return false}
+      if extensionFieldValues != other.extensionFieldValues {return false}
+      return true
+    }
+
+    func copy() -> _StorageClass {
+      let clone = _StorageClass()
+      clone.unknown = unknown
+      clone.extensionFieldValues = extensionFieldValues
+      clone._optionalInt32 = _optionalInt32
+      clone._fixed32 = _fixed32
+      clone._repeatedInt32 = _repeatedInt32
+      clone._packedInt32 = _packedInt32
+      clone._optionalEnum = _optionalEnum
+      clone._optionalString = _optionalString
+      clone._optionalBytes = _optionalBytes
+      clone._optionalMessage = _optionalMessage
+      clone._optionalGroup = _optionalGroup
+      clone._stringStringMap = _stringStringMap
+      clone._oneofField = _oneofField
+      return clone
+    }
+  }
+
+  private var _storage = _StorageClass()
+
+  public var unknown: ProtobufUnknownStorage {
+    get {return _storage.unknown}
+    set {_storage.unknown = newValue}
+  }
+
+  enum OneOf_OneofField: ExpressibleByNilLiteral, ProtobufOneofEnum {
+    case oneofUint32(UInt32)
+    case oneofTestAllTypes(ProtobufUnittest_TestAllTypesLite)
+    case oneofString(String)
+    case oneofBytes(Data)
+    case None
+
+    public init(nilLiteral: ()) {
+      self = .None
+    }
+
+    public init() {
+      self = .None
+    }
+
+    public mutating func decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+      if self != .None && setter.rejectConflictingOneof {
+        throw ProtobufDecodingError.duplicatedOneOf
+      }
+      switch protoFieldNumber {
+      case 536870011:
+        var value: UInt32?
+        try setter.decodeSingularField(fieldType: ProtobufUInt32.self, value: &value)
+        if let value = value {
+          self = .oneofUint32(value)
+        }
+      case 536870012:
+        var value: ProtobufUnittest_TestAllTypesLite?
+        try setter.decodeSingularMessageField(fieldType: ProtobufUnittest_TestAllTypesLite.self, value: &value)
+        if let value = value {
+          self = .oneofTestAllTypes(value)
+        }
+      case 536870013:
+        var value: String?
+        try setter.decodeSingularField(fieldType: ProtobufString.self, value: &value)
+        if let value = value {
+          self = .oneofString(value)
+        }
+      case 536870014:
+        var value: Data?
+        try setter.decodeSingularField(fieldType: ProtobufBytes.self, value: &value)
+        if let value = value {
+          self = .oneofBytes(value)
+        }
+      default:
+        self = .None
+      }
+    }
+
+    public func traverse(visitor: inout ProtobufVisitor, start: Int, end: Int) throws {
+      switch self {
+      case .oneofUint32(let v):
+        if start <= 536870011 && 536870011 < end {
+          try visitor.visitSingularField(fieldType: ProtobufUInt32.self, value: v, protoFieldNumber: 536870011)
+        }
+      case .oneofTestAllTypes(let v):
+        if start <= 536870012 && 536870012 < end {
+          try visitor.visitSingularMessageField(value: v, protoFieldNumber: 536870012)
+        }
+      case .oneofString(let v):
+        if start <= 536870013 && 536870013 < end {
+          try visitor.visitSingularField(fieldType: ProtobufString.self, value: v, protoFieldNumber: 536870013)
+        }
+      case .oneofBytes(let v):
+        if start <= 536870014 && 536870014 < end {
+          try visitor.visitSingularField(fieldType: ProtobufBytes.self, value: v, protoFieldNumber: 536870014)
+        }
+      case .None:
+        break
+      }
+    }
+  }
+
+  struct OptionalGroup: ProtobufGeneratedMessage, ProtobufProto2Message, ProtoNameProviding {
+    public var swiftClassName: String {return "ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup"}
+    public var protoMessageName: String {return "OptionalGroup"}
+    public var protoPackageName: String {return "protobuf_unittest"}
+    public static let _protobuf_fieldNames: FieldNameMap = [
+      536870009: .unique(proto: "group_a", json: "groupA", swift: "groupA"),
+    ]
+
+    public var unknown = ProtobufUnknownStorage()
+
+    private var _groupA: Int32? = nil
+    var groupA: Int32 {
+      get {return _groupA ?? 0}
+      set {_groupA = newValue}
+    }
+    public var hasGroupA: Bool {
+      return _groupA != nil
+    }
+    public mutating func clearGroupA() {
+      return _groupA = nil
+    }
+
+    init() {}
+
+    public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+      switch protoFieldNumber {
+      case 536870009: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_groupA)
+      default: break
+      }
+    }
+
+    public func _protoc_generated_traverse(visitor: inout ProtobufVisitor) throws {
+      if let v = _groupA {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 536870009)
+      }
+      unknown.traverse(visitor: &visitor)
+    }
+
+    public func _protoc_generated_isEqualTo(other: ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup) -> Bool {
+      if (groupA != other.groupA) {return false}
+      if unknown != other.unknown {return false}
+      return true
+    }
+  }
+
+  var optionalInt32: Int32 {
+    get {return _storage._optionalInt32 ?? 0}
+    set {_uniqueStorage()._optionalInt32 = newValue}
+  }
+  public var hasOptionalInt32: Bool {
+    return _storage._optionalInt32 != nil
+  }
+  public mutating func clearOptionalInt32() {
+    return _storage._optionalInt32 = nil
+  }
+
+  var fixed32: Int32 {
+    get {return _storage._fixed32 ?? 0}
+    set {_uniqueStorage()._fixed32 = newValue}
+  }
+  public var hasFixed32: Bool {
+    return _storage._fixed32 != nil
+  }
+  public mutating func clearFixed32() {
+    return _storage._fixed32 = nil
+  }
+
+  var repeatedInt32: [Int32] {
+    get {return _storage._repeatedInt32}
+    set {_uniqueStorage()._repeatedInt32 = newValue}
+  }
+
+  var packedInt32: [Int32] {
+    get {return _storage._packedInt32}
+    set {_uniqueStorage()._packedInt32 = newValue}
+  }
+
+  var optionalEnum: ProtobufUnittest_ForeignEnumLite {
+    get {return _storage._optionalEnum ?? ProtobufUnittest_ForeignEnumLite.foreignLiteFoo}
+    set {_uniqueStorage()._optionalEnum = newValue}
+  }
+  public var hasOptionalEnum: Bool {
+    return _storage._optionalEnum != nil
+  }
+  public mutating func clearOptionalEnum() {
+    return _storage._optionalEnum = nil
+  }
+
+  var optionalString: String {
+    get {return _storage._optionalString ?? ""}
+    set {_uniqueStorage()._optionalString = newValue}
+  }
+  public var hasOptionalString: Bool {
+    return _storage._optionalString != nil
+  }
+  public mutating func clearOptionalString() {
+    return _storage._optionalString = nil
+  }
+
+  var optionalBytes: Data {
+    get {return _storage._optionalBytes ?? Data()}
+    set {_uniqueStorage()._optionalBytes = newValue}
+  }
+  public var hasOptionalBytes: Bool {
+    return _storage._optionalBytes != nil
+  }
+  public mutating func clearOptionalBytes() {
+    return _storage._optionalBytes = nil
+  }
+
+  var optionalMessage: ProtobufUnittest_ForeignMessageLite {
+    get {return _storage._optionalMessage ?? ProtobufUnittest_ForeignMessageLite()}
+    set {_uniqueStorage()._optionalMessage = newValue}
+  }
+  public var hasOptionalMessage: Bool {
+    return _storage._optionalMessage != nil
+  }
+  public mutating func clearOptionalMessage() {
+    return _storage._optionalMessage = nil
+  }
+
+  var optionalGroup: ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup {
+    get {return _storage._optionalGroup ?? ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup()}
+    set {_uniqueStorage()._optionalGroup = newValue}
+  }
+  public var hasOptionalGroup: Bool {
+    return _storage._optionalGroup != nil
+  }
+  public mutating func clearOptionalGroup() {
+    return _storage._optionalGroup = nil
+  }
+
+  var stringStringMap: Dictionary<String,String> {
+    get {return _storage._stringStringMap}
+    set {_uniqueStorage()._stringStringMap = newValue}
+  }
+
+  var oneofUint32: UInt32 {
+    get {
+      if case .oneofUint32(let v) = _storage._oneofField {
+        return v
+      }
+      return 0
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofUint32(newValue)
+    }
+  }
+
+  var oneofTestAllTypes: ProtobufUnittest_TestAllTypesLite {
+    get {
+      if case .oneofTestAllTypes(let v) = _storage._oneofField {
+        return v
+      }
+      return ProtobufUnittest_TestAllTypesLite()
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofTestAllTypes(newValue)
+    }
+  }
+
+  var oneofString: String {
+    get {
+      if case .oneofString(let v) = _storage._oneofField {
+        return v
+      }
+      return ""
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofString(newValue)
+    }
+  }
+
+  var oneofBytes: Data {
+    get {
+      if case .oneofBytes(let v) = _storage._oneofField {
+        return v
+      }
+      return Data()
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofBytes(newValue)
+    }
+  }
+
+  public var oneofField: OneOf_OneofField {
+    get {return _storage._oneofField}
+    set {
+      _uniqueStorage()._oneofField = newValue
+    }
+  }
+
+  init() {}
+
+  public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+    try _uniqueStorage().decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+  }
+
+  public func _protoc_generated_traverse(visitor: inout ProtobufVisitor) throws {
+    try _storage.traverse(visitor: &visitor)
+  }
+
+  public func _protoc_generated_isEqualTo(other: ProtobufUnittest_TestHugeFieldNumbersLite) -> Bool {
+    return _storage === other._storage || _storage.isEqualTo(other: other._storage)
+  }
+
+  private mutating func _uniqueStorage() -> _StorageClass {
+    if !isKnownUniquelyReferenced(&_storage) {
+      _storage = _storage.copy()
+    }
+    return _storage
+  }
+
+  public mutating func setExtensionValue<F: ProtobufExtensionField>(ext: ProtobufGenericMessageExtension<F, ProtobufUnittest_TestHugeFieldNumbersLite>, value: F.ValueType) {
+    return _uniqueStorage().setExtensionValue(ext: ext, value: value)
+  }
+
+  public mutating func clearExtensionValue<F: ProtobufExtensionField>(ext: ProtobufGenericMessageExtension<F, ProtobufUnittest_TestHugeFieldNumbersLite>) {
+    return _storage.clearExtensionValue(ext: ext)
+  }
+
+  public func getExtensionValue<F: ProtobufExtensionField>(ext: ProtobufGenericMessageExtension<F, ProtobufUnittest_TestHugeFieldNumbersLite>) -> F.ValueType {
+    return _storage.getExtensionValue(ext: ext)
+  }
+
+  public func hasExtensionValue<F: ProtobufExtensionField>(ext: ProtobufGenericMessageExtension<F, ProtobufUnittest_TestHugeFieldNumbersLite>) -> Bool {
+    return _storage.hasExtensionValue(ext: ext)
+  }
+  public func _protobuf_fieldNames(for number: Int) -> FieldNameMap.Names? {
+    return ProtobufUnittest_TestHugeFieldNumbersLite._protobuf_fieldNames.fieldNames(for: number) ?? _storage.extensionFieldValues.fieldNames(for: number)
+  }
+}
+
 ///   Singular
 let ProtobufUnittest_Extensions_optionalInt32ExtensionLite = ProtobufGenericMessageExtension<ProtobufOptionalField<ProtobufInt32>, ProtobufUnittest_TestAllExtensionsLite>(protoFieldNumber: 1, fieldNames: .unique(proto: "optional_int32_extension_lite", json: "optionalInt32ExtensionLite", swift: "ProtobufUnittest_optionalInt32ExtensionLite"), defaultValue: 0)
 
@@ -3352,6 +3815,8 @@ let ProtobufUnittest_Extensions_packedBoolExtensionLite = ProtobufGenericMessage
 
 let ProtobufUnittest_Extensions_packedEnumExtensionLite = ProtobufGenericMessageExtension<ProtobufPackedField<ProtobufUnittest_ForeignEnumLite>, ProtobufUnittest_TestPackedExtensionsLite>(protoFieldNumber: 103, fieldNames: .unique(proto: "packed_enum_extension_lite", json: "packedEnumExtensionLite", swift: "ProtobufUnittest_packedEnumExtensionLite"), defaultValue: [])
 
+let ProtobufUnittest_Extensions_testAllTypesLite = ProtobufGenericMessageExtension<ProtobufOptionalMessageField<ProtobufUnittest_TestAllTypesLite>, ProtobufUnittest_TestHugeFieldNumbersLite>(protoFieldNumber: 536860000, fieldNames: .unique(proto: "test_all_types_lite", json: "testAllTypesLite", swift: "ProtobufUnittest_testAllTypesLite"), defaultValue: ProtobufUnittest_TestAllTypesLite())
+
 func ==(lhs: ProtobufUnittest_TestAllTypesLite.OneOf_OneofField, rhs: ProtobufUnittest_TestAllTypesLite.OneOf_OneofField) -> Bool {
   switch (lhs, rhs) {
   case (.oneofUint32(let l), .oneofUint32(let r)): return l == r
@@ -3403,6 +3868,17 @@ extension ProtobufUnittest_TestParsingMergeLite {
   }
 }
 
+func ==(lhs: ProtobufUnittest_TestHugeFieldNumbersLite.OneOf_OneofField, rhs: ProtobufUnittest_TestHugeFieldNumbersLite.OneOf_OneofField) -> Bool {
+  switch (lhs, rhs) {
+  case (.oneofUint32(let l), .oneofUint32(let r)): return l == r
+  case (.oneofTestAllTypes(let l), .oneofTestAllTypes(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 (.None, .None): return true
+  default: return false
+  }
+}
+
 extension ProtobufUnittest_TestAllExtensionsLite {
   ///   Singular
   var ProtobufUnittest_optionalInt32ExtensionLite: Int32 {
@@ -4564,6 +5040,19 @@ extension ProtobufUnittest_TestPackedExtensionsLite {
   }
 }
 
+extension ProtobufUnittest_TestHugeFieldNumbersLite {
+  var ProtobufUnittest_testAllTypesLite: ProtobufUnittest_TestAllTypesLite {
+    get {return getExtensionValue(ext: ProtobufUnittest_Extensions_testAllTypesLite) ?? ProtobufUnittest_TestAllTypesLite()}
+    set {setExtensionValue(ext: ProtobufUnittest_Extensions_testAllTypesLite, value: newValue)}
+  }
+  var hasProtobufUnittest_testAllTypesLite: Bool {
+    return hasExtensionValue(ext: ProtobufUnittest_Extensions_testAllTypesLite)
+  }
+  mutating func clearProtobufUnittest_testAllTypesLite() {
+    clearExtensionValue(ext: ProtobufUnittest_Extensions_testAllTypesLite)
+  }
+}
+
 let ProtobufUnittest_UnittestLite_Extensions: ProtobufExtensionSet = [
   ProtobufUnittest_Extensions_optionalInt32ExtensionLite,
   ProtobufUnittest_Extensions_optionalInt64ExtensionLite,
@@ -4654,6 +5143,7 @@ let ProtobufUnittest_UnittestLite_Extensions: ProtobufExtensionSet = [
   ProtobufUnittest_Extensions_packedDoubleExtensionLite,
   ProtobufUnittest_Extensions_packedBoolExtensionLite,
   ProtobufUnittest_Extensions_packedEnumExtensionLite,
+  ProtobufUnittest_Extensions_testAllTypesLite,
   ProtobufUnittest_TestNestedExtensionLite.Extensions.nestedExtension,
   ProtobufUnittest_TestParsingMergeLite.Extensions.optionalExt,
   ProtobufUnittest_TestParsingMergeLite.Extensions.repeatedExt

+ 112 - 18
Sources/PluginLibrary/descriptor.pb.swift

@@ -1037,8 +1037,6 @@ public struct Google_Protobuf_FieldDescriptorProto: ProtobufGeneratedMessage, Pr
     ///   0 is reserved for errors
     case `optional` // = 1
     case `required` // = 2
-
-    ///   TODO(sanjay): Should we add LABEL_MAP?
     case repeated // = 3
 
     public init() {
@@ -2102,18 +2100,7 @@ public struct Google_Protobuf_FileOptions: ProtobufGeneratedMessage, ProtobufPro
     return _javaMultipleFiles = nil
   }
 
-  ///   If set true, then the Java code generator will generate equals() and
-  ///   hashCode() methods for all messages defined in the .proto file.
-  ///   This increases generated code size, potentially substantially for large
-  ///   protos, which may harm a memory-constrained application.
-  ///   - In the full runtime this is a speed optimization, as the
-  ///   AbstractMessage base class includes reflection-based implementations of
-  ///   these methods.
-  ///   - In the lite runtime, setting this option changes the semantics of
-  ///   equals() and hashCode() to more closely match those of the full runtime;
-  ///   the generated methods compute their results based on field values rather
-  ///   than object identity. (Implementations should not assume that hashcodes
-  ///   will be consistent across runtimes or versions of the protocol compiler.)
+  ///   This option does nothing.
   private var _javaGenerateEqualsAndHash: Bool? = nil
   public var javaGenerateEqualsAndHash: Bool {
     get {return _javaGenerateEqualsAndHash ?? false}
@@ -2276,8 +2263,10 @@ public struct Google_Protobuf_FileOptions: ProtobufGeneratedMessage, ProtobufPro
     return _csharpNamespace = nil
   }
 
-  ///   Prefix prepended to all Swift generated top-level types.
-  ///   Default is CamelCased package name.
+  ///   By default Swift generators will take the proto package and CamelCase it
+  ///   replacing '.' with underscore and use that to prefix the types/symbols
+  ///   defined. When this options is provided, they will use this value instead
+  ///   to prefix the types/symbols defined.
   private var _swiftPrefix: String? = nil
   public var swiftPrefix: String {
     get {return _swiftPrefix ?? ""}
@@ -2376,7 +2365,7 @@ public struct Google_Protobuf_FileOptions: ProtobufGeneratedMessage, ProtobufPro
     if (javaPackage != other.javaPackage) {return false}
     if (javaOuterClassname != other.javaOuterClassname) {return false}
     if (((_javaMultipleFiles != nil && _javaMultipleFiles! != false) || (other._javaMultipleFiles != nil && other._javaMultipleFiles! != false)) && (_javaMultipleFiles == nil || other._javaMultipleFiles == nil || _javaMultipleFiles! != other._javaMultipleFiles!)) {return false}
-    if (((_javaGenerateEqualsAndHash != nil && _javaGenerateEqualsAndHash! != false) || (other._javaGenerateEqualsAndHash != nil && other._javaGenerateEqualsAndHash! != false)) && (_javaGenerateEqualsAndHash == nil || other._javaGenerateEqualsAndHash == nil || _javaGenerateEqualsAndHash! != other._javaGenerateEqualsAndHash!)) {return false}
+    if (javaGenerateEqualsAndHash != other.javaGenerateEqualsAndHash) {return false}
     if (((_javaStringCheckUtf8 != nil && _javaStringCheckUtf8! != false) || (other._javaStringCheckUtf8 != nil && other._javaStringCheckUtf8! != false)) && (_javaStringCheckUtf8 == nil || other._javaStringCheckUtf8 == nil || _javaStringCheckUtf8! != other._javaStringCheckUtf8!)) {return false}
     if (((_optimizeFor != nil && _optimizeFor! != Google_Protobuf_FileOptions.OptimizeMode.speed) || (other._optimizeFor != nil && other._optimizeFor! != Google_Protobuf_FileOptions.OptimizeMode.speed)) && (_optimizeFor == nil || other._optimizeFor == nil || _optimizeFor! != other._optimizeFor!)) {return false}
     if (goPackage != other.goPackage) {return false}
@@ -2858,7 +2847,7 @@ public struct Google_Protobuf_FieldOptions: ProtobufGeneratedMessage, ProtobufPr
   ///  
   ///  
   ///   Note that implementations may choose not to check required fields within
-  ///   a lazy sub-message.  That is, calling IsInitialized() on the outher message
+  ///   a lazy sub-message.  That is, calling IsInitialized() on the outer message
   ///   may return true even if the inner message has missing required fields.
   ///   This is necessary because otherwise the inner message would have to be
   ///   parsed in order to perform the check, defeating the purpose of lazy
@@ -3345,11 +3334,99 @@ public struct Google_Protobuf_MethodOptions: ProtobufGeneratedMessage, ProtobufP
   public var protoPackageName: String {return "google.protobuf"}
   public static let _protobuf_fieldNames: FieldNameMap = [
     33: .same(proto: "deprecated", swift: "deprecated"),
+    34: .unique(proto: "idempotency_level", json: "idempotencyLevel", swift: "idempotencyLevel"),
     999: .unique(proto: "uninterpreted_option", json: "uninterpretedOption", swift: "uninterpretedOption"),
   ]
 
   public var unknown = ProtobufUnknownStorage()
 
+  ///   Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
+  ///   or neither? HTTP based RPC implementation may choose GET verb for safe
+  ///   methods, and PUT verb for idempotent methods instead of the default POST.
+  public enum IdempotencyLevel: ProtobufEnum {
+    public typealias RawValue = Int
+    case idempotencyUnknown // = 0
+
+    ///   implies idempotent
+    case noSideEffects // = 1
+
+    ///   idempotent, but may have side effects
+    case idempotent // = 2
+
+    public init() {
+      self = .idempotencyUnknown
+    }
+
+    public init?(rawValue: Int) {
+      switch rawValue {
+      case 0: self = .idempotencyUnknown
+      case 1: self = .noSideEffects
+      case 2: self = .idempotent
+      default: return nil
+      }
+    }
+
+    public init?(name: String) {
+      switch name {
+      case "idempotencyUnknown": self = .idempotencyUnknown
+      case "noSideEffects": self = .noSideEffects
+      case "idempotent": self = .idempotent
+      default: return nil
+      }
+    }
+
+    public init?(jsonName: String) {
+      switch jsonName {
+      case "IDEMPOTENCY_UNKNOWN": self = .idempotencyUnknown
+      case "NO_SIDE_EFFECTS": self = .noSideEffects
+      case "IDEMPOTENT": self = .idempotent
+      default: return nil
+      }
+    }
+
+    public init?(protoName: String) {
+      switch protoName {
+      case "IDEMPOTENCY_UNKNOWN": self = .idempotencyUnknown
+      case "NO_SIDE_EFFECTS": self = .noSideEffects
+      case "IDEMPOTENT": self = .idempotent
+      default: return nil
+      }
+    }
+
+    public var rawValue: Int {
+      get {
+        switch self {
+        case .idempotencyUnknown: return 0
+        case .noSideEffects: return 1
+        case .idempotent: return 2
+        }
+      }
+    }
+
+    public var json: String {
+      get {
+        switch self {
+        case .idempotencyUnknown: return "\"IDEMPOTENCY_UNKNOWN\""
+        case .noSideEffects: return "\"NO_SIDE_EFFECTS\""
+        case .idempotent: return "\"IDEMPOTENT\""
+        }
+      }
+    }
+
+    public var hashValue: Int { return rawValue }
+
+    public var debugDescription: String {
+      get {
+        switch self {
+        case .idempotencyUnknown: return ".idempotencyUnknown"
+        case .noSideEffects: return ".noSideEffects"
+        case .idempotent: return ".idempotent"
+        }
+      }
+    }
+
+  }
+
   //  Note:  Field numbers 1 through 32 are reserved for Google's internal RPC
   //    framework.  We apologize for hoarding these numbers to ourselves, but
   //    we were already using them long before we decided to release Protocol
@@ -3371,6 +3448,18 @@ public struct Google_Protobuf_MethodOptions: ProtobufGeneratedMessage, ProtobufP
     return _deprecated = nil
   }
 
+  private var _idempotencyLevel: Google_Protobuf_MethodOptions.IdempotencyLevel? = nil
+  public var idempotencyLevel: Google_Protobuf_MethodOptions.IdempotencyLevel {
+    get {return _idempotencyLevel ?? Google_Protobuf_MethodOptions.IdempotencyLevel.idempotencyUnknown}
+    set {_idempotencyLevel = newValue}
+  }
+  public var hasIdempotencyLevel: Bool {
+    return _idempotencyLevel != nil
+  }
+  public mutating func clearIdempotencyLevel() {
+    return _idempotencyLevel = nil
+  }
+
   ///   The parser stores options it doesn't recognize here. See above.
   public var uninterpretedOption: [Google_Protobuf_UninterpretedOption] = []
 
@@ -3379,6 +3468,7 @@ public struct Google_Protobuf_MethodOptions: ProtobufGeneratedMessage, ProtobufP
   public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
     switch protoFieldNumber {
     case 33: try setter.decodeSingularField(fieldType: ProtobufBool.self, value: &_deprecated)
+    case 34: try setter.decodeSingularField(fieldType: Google_Protobuf_MethodOptions.IdempotencyLevel.self, value: &_idempotencyLevel)
     case 999: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_UninterpretedOption.self, value: &uninterpretedOption)
     default: if (1000 <= protoFieldNumber && protoFieldNumber < 536870912) {
         try setter.decodeExtensionField(values: &extensionFieldValues, messageType: Google_Protobuf_MethodOptions.self, protoFieldNumber: protoFieldNumber)
@@ -3390,6 +3480,9 @@ public struct Google_Protobuf_MethodOptions: ProtobufGeneratedMessage, ProtobufP
     if let v = _deprecated {
       try visitor.visitSingularField(fieldType: ProtobufBool.self, value: v, protoFieldNumber: 33)
     }
+    if let v = _idempotencyLevel {
+      try visitor.visitSingularField(fieldType: Google_Protobuf_MethodOptions.IdempotencyLevel.self, value: v, protoFieldNumber: 34)
+    }
     if !uninterpretedOption.isEmpty {
       try visitor.visitRepeatedMessageField(value: uninterpretedOption, protoFieldNumber: 999)
     }
@@ -3399,6 +3492,7 @@ public struct Google_Protobuf_MethodOptions: ProtobufGeneratedMessage, ProtobufP
 
   public func _protoc_generated_isEqualTo(other: Google_Protobuf_MethodOptions) -> Bool {
     if (((_deprecated != nil && _deprecated! != false) || (other._deprecated != nil && other._deprecated! != false)) && (_deprecated == nil || other._deprecated == nil || _deprecated! != other._deprecated!)) {return false}
+    if (((_idempotencyLevel != nil && _idempotencyLevel! != Google_Protobuf_MethodOptions.IdempotencyLevel.idempotencyUnknown) || (other._idempotencyLevel != nil && other._idempotencyLevel! != Google_Protobuf_MethodOptions.IdempotencyLevel.idempotencyUnknown)) && (_idempotencyLevel == nil || other._idempotencyLevel == nil || _idempotencyLevel! != other._idempotencyLevel!)) {return false}
     if uninterpretedOption != other.uninterpretedOption {return false}
     if unknown != other.unknown {return false}
     if extensionFieldValues != other.extensionFieldValues {return false}

+ 6 - 0
Sources/SwiftProtobuf/duration.pb.swift

@@ -79,6 +79,12 @@ import Foundation
 ///         end.seconds += 1;
 ///         end.nanos -= 1000000000;
 ///       }
+///  
+///   Example 3: Compute Duration from datetime.timedelta in Python.
+///  
+///       td = datetime.timedelta(days=3, minutes=10)
+///       duration = Duration()
+///       duration.FromTimedelta(td)
 public struct Google_Protobuf_Duration: ProtobufGeneratedMessage, ProtobufProto3Message, ProtoNameProviding {
   public var swiftClassName: String {return "Google_Protobuf_Duration"}
   public var protoMessageName: String {return "Duration"}

+ 3 - 3
Sources/SwiftProtobuf/field_mask.pb.swift

@@ -82,7 +82,7 @@ import Foundation
 ///       }
 ///  
 ///   A repeated field is not allowed except at the last position of a
-///   field mask.
+///   paths string.
 ///  
 ///   If a FieldMask object is not present in a get operation, the
 ///   operation applies to all fields (as if a FieldMask of all fields
@@ -109,8 +109,8 @@ import Foundation
 ///  
 ///   If a repeated field is specified for an update operation, the existing
 ///   repeated values in the target resource will be overwritten by the new values.
-///   Note that a repeated field is only allowed in the last position of a field
-///   mask.
+///   Note that a repeated field is only allowed in the last position of a `paths`
+///   string.
 ///  
 ///   If a sub-message is specified in the last position of the field mask for an
 ///   update operation, then the existing sub-message in the target resource is

+ 3 - 5
Sources/SwiftProtobuf/timestamp.pb.swift

@@ -88,10 +88,8 @@ import Foundation
 ///  
 ///   Example 5: Compute Timestamp from current time in Python.
 ///  
-///       now = time.time()
-///       seconds = int(now)
-///       nanos = int((now - seconds) * 10**9)
-///       timestamp = Timestamp(seconds=seconds, nanos=nanos)
+///       timestamp = Timestamp()
+///       timestamp.GetCurrentTime()
 public struct Google_Protobuf_Timestamp: ProtobufGeneratedMessage, ProtobufProto3Message, ProtoNameProviding {
   public var swiftClassName: String {return "Google_Protobuf_Timestamp"}
   public var protoMessageName: String {return "Timestamp"}
@@ -103,7 +101,7 @@ public struct Google_Protobuf_Timestamp: ProtobufGeneratedMessage, ProtobufProto
 
 
   ///   Represents seconds of UTC time since Unix epoch
-  ///   1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to
+  ///   1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
   ///   9999-12-31T23:59:59Z inclusive.
   public var seconds: Int64 = 0
 

+ 196 - 2
Tests/SwiftProtobufTests/conformance.pb.swift

@@ -624,6 +624,11 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
     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"),
@@ -666,6 +671,12 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
     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 {
@@ -775,6 +786,12 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
     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() {}
 
@@ -842,7 +859,7 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
       case 72: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufString,Conformance_ForeignMessage>.self, value: &_mapStringForeignMessage)
       case 73: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufString,Conformance_TestAllTypes.NestedEnum>.self, value: &_mapStringNestedEnum)
       case 74: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufString,Conformance_ForeignEnum>.self, value: &_mapStringForeignEnum)
-      case 111, 112, 113, 114: try _oneofField.decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+      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)
@@ -885,6 +902,12 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
       case 410: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName10)
       case 411: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName11)
       case 412: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName12)
+      case 413: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &__FieldName13)
+      case 414: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &__FieldName14)
+      case 415: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_field_Name15)
+      case 416: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_field_Name16)
+      case 417: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName17__)
+      case 418: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName18__)
       default: break
       }
     }
@@ -1076,7 +1099,7 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
       if !_mapStringForeignEnum.isEmpty {
         try visitor.visitMapField(fieldType: ProtobufMap<ProtobufString,Conformance_ForeignEnum>.self, value: _mapStringForeignEnum, protoFieldNumber: 74)
       }
-      try _oneofField.traverse(visitor: &visitor, start: 111, end: 115)
+      try _oneofField.traverse(visitor: &visitor, start: 111, end: 120)
       if let v = _optionalBoolWrapper {
         try visitor.visitSingularMessageField(value: v, protoFieldNumber: 201)
       }
@@ -1203,6 +1226,24 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
       if _fieldName12 != 0 {
         try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: _fieldName12, protoFieldNumber: 412)
       }
+      if __FieldName13 != 0 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: __FieldName13, protoFieldNumber: 413)
+      }
+      if __FieldName14 != 0 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: __FieldName14, protoFieldNumber: 414)
+      }
+      if _field_Name15 != 0 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: _field_Name15, protoFieldNumber: 415)
+      }
+      if _field_Name16 != 0 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: _field_Name16, protoFieldNumber: 416)
+      }
+      if _fieldName17__ != 0 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: _fieldName17__, protoFieldNumber: 417)
+      }
+      if _fieldName18__ != 0 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: _fieldName18__, protoFieldNumber: 418)
+      }
     }
 
     func isEqualTo(other: _StorageClass) -> Bool {
@@ -1311,6 +1352,12 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
       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
     }
 
@@ -1421,6 +1468,12 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
       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
     }
   }
@@ -1433,6 +1486,11 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
     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: ()) {
@@ -1466,6 +1524,26 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
         var value = Data()
         try setter.decodeSingularField(fieldType: ProtobufBytes.self, value: &value)
         self = .oneofBytes(value)
+      case 115:
+        var value = Bool()
+        try setter.decodeSingularField(fieldType: ProtobufBool.self, value: &value)
+        self = .oneofBool(value)
+      case 116:
+        var value = UInt64()
+        try setter.decodeSingularField(fieldType: ProtobufUInt64.self, value: &value)
+        self = .oneofUint64(value)
+      case 117:
+        var value = Float()
+        try setter.decodeSingularField(fieldType: ProtobufFloat.self, value: &value)
+        self = .oneofFloat(value)
+      case 118:
+        var value = Double()
+        try setter.decodeSingularField(fieldType: 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
       }
@@ -1489,6 +1567,26 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
         if start <= 114 && 114 < end {
           try visitor.visitSingularField(fieldType: ProtobufBytes.self, value: v, protoFieldNumber: 114)
         }
+      case .oneofBool(let v):
+        if start <= 115 && 115 < end {
+          try visitor.visitSingularField(fieldType: ProtobufBool.self, value: v, protoFieldNumber: 115)
+        }
+      case .oneofUint64(let v):
+        if start <= 116 && 116 < end {
+          try visitor.visitSingularField(fieldType: ProtobufUInt64.self, value: v, protoFieldNumber: 116)
+        }
+      case .oneofFloat(let v):
+        if start <= 117 && 117 < end {
+          try visitor.visitSingularField(fieldType: ProtobufFloat.self, value: v, protoFieldNumber: 117)
+        }
+      case .oneofDouble(let v):
+        if start <= 118 && 118 < end {
+          try visitor.visitSingularField(fieldType: 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
       }
@@ -2056,6 +2154,66 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
     }
   }
 
+  var oneofBool: Bool {
+    get {
+      if case .oneofBool(let v) = _storage._oneofField {
+        return v
+      }
+      return false
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofBool(newValue)
+    }
+  }
+
+  var oneofUint64: UInt64 {
+    get {
+      if case .oneofUint64(let v) = _storage._oneofField {
+        return v
+      }
+      return 0
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofUint64(newValue)
+    }
+  }
+
+  var oneofFloat: Float {
+    get {
+      if case .oneofFloat(let v) = _storage._oneofField {
+        return v
+      }
+      return 0
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofFloat(newValue)
+    }
+  }
+
+  var oneofDouble: Double {
+    get {
+      if case .oneofDouble(let v) = _storage._oneofField {
+        return v
+      }
+      return 0
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofDouble(newValue)
+    }
+  }
+
+  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
   var optionalBoolWrapper: Google_Protobuf_BoolValue {
     get {return _storage._optionalBoolWrapper ?? Google_Protobuf_BoolValue()}
@@ -2298,6 +2456,7 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
   }
 
   ///   Test field-name-to-JSON-name convention.
+  ///   (protobuf says names can be any valid C/C++ identifier.)
   var fieldname1: Int32 {
     get {return _storage._fieldname1}
     set {_uniqueStorage()._fieldname1 = newValue}
@@ -2358,6 +2517,36 @@ struct Conformance_TestAllTypes: ProtobufGeneratedMessage, ProtobufProto3Message
     set {_uniqueStorage()._fieldName12 = newValue}
   }
 
+  var _FieldName13: Int32 {
+    get {return _storage.__FieldName13}
+    set {_uniqueStorage().__FieldName13 = newValue}
+  }
+
+  var _FieldName14: Int32 {
+    get {return _storage.__FieldName14}
+    set {_uniqueStorage().__FieldName14 = newValue}
+  }
+
+  var field_Name15: Int32 {
+    get {return _storage._field_Name15}
+    set {_uniqueStorage()._field_Name15 = newValue}
+  }
+
+  var field_Name16: Int32 {
+    get {return _storage._field_Name16}
+    set {_uniqueStorage()._field_Name16 = newValue}
+  }
+
+  var fieldName17__: Int32 {
+    get {return _storage._fieldName17__}
+    set {_uniqueStorage()._fieldName17__ = newValue}
+  }
+
+  var fieldName18__: Int32 {
+    get {return _storage._fieldName18__}
+    set {_uniqueStorage()._fieldName18__ = newValue}
+  }
+
   public var oneofField: OneOf_OneofField {
     get {return _storage._oneofField}
     set {
@@ -2447,6 +2636,11 @@ func ==(lhs: Conformance_TestAllTypes.OneOf_OneofField, rhs: Conformance_TestAll
   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
   }

+ 112 - 18
Tests/SwiftProtobufTests/descriptor.pb.swift

@@ -1037,8 +1037,6 @@ struct Google_Protobuf_FieldDescriptorProto: ProtobufGeneratedMessage, ProtobufP
     ///   0 is reserved for errors
     case `optional` // = 1
     case `required` // = 2
-
-    ///   TODO(sanjay): Should we add LABEL_MAP?
     case repeated // = 3
 
     init() {
@@ -2102,18 +2100,7 @@ struct Google_Protobuf_FileOptions: ProtobufGeneratedMessage, ProtobufProto2Mess
     return _javaMultipleFiles = nil
   }
 
-  ///   If set true, then the Java code generator will generate equals() and
-  ///   hashCode() methods for all messages defined in the .proto file.
-  ///   This increases generated code size, potentially substantially for large
-  ///   protos, which may harm a memory-constrained application.
-  ///   - In the full runtime this is a speed optimization, as the
-  ///   AbstractMessage base class includes reflection-based implementations of
-  ///   these methods.
-  ///   - In the lite runtime, setting this option changes the semantics of
-  ///   equals() and hashCode() to more closely match those of the full runtime;
-  ///   the generated methods compute their results based on field values rather
-  ///   than object identity. (Implementations should not assume that hashcodes
-  ///   will be consistent across runtimes or versions of the protocol compiler.)
+  ///   This option does nothing.
   private var _javaGenerateEqualsAndHash: Bool? = nil
   var javaGenerateEqualsAndHash: Bool {
     get {return _javaGenerateEqualsAndHash ?? false}
@@ -2276,8 +2263,10 @@ struct Google_Protobuf_FileOptions: ProtobufGeneratedMessage, ProtobufProto2Mess
     return _csharpNamespace = nil
   }
 
-  ///   Prefix prepended to all Swift generated top-level types.
-  ///   Default is CamelCased package name.
+  ///   By default Swift generators will take the proto package and CamelCase it
+  ///   replacing '.' with underscore and use that to prefix the types/symbols
+  ///   defined. When this options is provided, they will use this value instead
+  ///   to prefix the types/symbols defined.
   private var _swiftPrefix: String? = nil
   var swiftPrefix: String {
     get {return _swiftPrefix ?? ""}
@@ -2376,7 +2365,7 @@ struct Google_Protobuf_FileOptions: ProtobufGeneratedMessage, ProtobufProto2Mess
     if (javaPackage != other.javaPackage) {return false}
     if (javaOuterClassname != other.javaOuterClassname) {return false}
     if (((_javaMultipleFiles != nil && _javaMultipleFiles! != false) || (other._javaMultipleFiles != nil && other._javaMultipleFiles! != false)) && (_javaMultipleFiles == nil || other._javaMultipleFiles == nil || _javaMultipleFiles! != other._javaMultipleFiles!)) {return false}
-    if (((_javaGenerateEqualsAndHash != nil && _javaGenerateEqualsAndHash! != false) || (other._javaGenerateEqualsAndHash != nil && other._javaGenerateEqualsAndHash! != false)) && (_javaGenerateEqualsAndHash == nil || other._javaGenerateEqualsAndHash == nil || _javaGenerateEqualsAndHash! != other._javaGenerateEqualsAndHash!)) {return false}
+    if (javaGenerateEqualsAndHash != other.javaGenerateEqualsAndHash) {return false}
     if (((_javaStringCheckUtf8 != nil && _javaStringCheckUtf8! != false) || (other._javaStringCheckUtf8 != nil && other._javaStringCheckUtf8! != false)) && (_javaStringCheckUtf8 == nil || other._javaStringCheckUtf8 == nil || _javaStringCheckUtf8! != other._javaStringCheckUtf8!)) {return false}
     if (((_optimizeFor != nil && _optimizeFor! != Google_Protobuf_FileOptions.OptimizeMode.speed) || (other._optimizeFor != nil && other._optimizeFor! != Google_Protobuf_FileOptions.OptimizeMode.speed)) && (_optimizeFor == nil || other._optimizeFor == nil || _optimizeFor! != other._optimizeFor!)) {return false}
     if (goPackage != other.goPackage) {return false}
@@ -2858,7 +2847,7 @@ struct Google_Protobuf_FieldOptions: ProtobufGeneratedMessage, ProtobufProto2Mes
   ///  
   ///  
   ///   Note that implementations may choose not to check required fields within
-  ///   a lazy sub-message.  That is, calling IsInitialized() on the outher message
+  ///   a lazy sub-message.  That is, calling IsInitialized() on the outer message
   ///   may return true even if the inner message has missing required fields.
   ///   This is necessary because otherwise the inner message would have to be
   ///   parsed in order to perform the check, defeating the purpose of lazy
@@ -3345,11 +3334,99 @@ struct Google_Protobuf_MethodOptions: ProtobufGeneratedMessage, ProtobufProto2Me
   public var protoPackageName: String {return "google.protobuf"}
   public static let _protobuf_fieldNames: FieldNameMap = [
     33: .same(proto: "deprecated", swift: "deprecated"),
+    34: .unique(proto: "idempotency_level", json: "idempotencyLevel", swift: "idempotencyLevel"),
     999: .unique(proto: "uninterpreted_option", json: "uninterpretedOption", swift: "uninterpretedOption"),
   ]
 
   public var unknown = ProtobufUnknownStorage()
 
+  ///   Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
+  ///   or neither? HTTP based RPC implementation may choose GET verb for safe
+  ///   methods, and PUT verb for idempotent methods instead of the default POST.
+  enum IdempotencyLevel: ProtobufEnum {
+    typealias RawValue = Int
+    case idempotencyUnknown // = 0
+
+    ///   implies idempotent
+    case noSideEffects // = 1
+
+    ///   idempotent, but may have side effects
+    case idempotent // = 2
+
+    init() {
+      self = .idempotencyUnknown
+    }
+
+    init?(rawValue: Int) {
+      switch rawValue {
+      case 0: self = .idempotencyUnknown
+      case 1: self = .noSideEffects
+      case 2: self = .idempotent
+      default: return nil
+      }
+    }
+
+    init?(name: String) {
+      switch name {
+      case "idempotencyUnknown": self = .idempotencyUnknown
+      case "noSideEffects": self = .noSideEffects
+      case "idempotent": self = .idempotent
+      default: return nil
+      }
+    }
+
+    init?(jsonName: String) {
+      switch jsonName {
+      case "IDEMPOTENCY_UNKNOWN": self = .idempotencyUnknown
+      case "NO_SIDE_EFFECTS": self = .noSideEffects
+      case "IDEMPOTENT": self = .idempotent
+      default: return nil
+      }
+    }
+
+    init?(protoName: String) {
+      switch protoName {
+      case "IDEMPOTENCY_UNKNOWN": self = .idempotencyUnknown
+      case "NO_SIDE_EFFECTS": self = .noSideEffects
+      case "IDEMPOTENT": self = .idempotent
+      default: return nil
+      }
+    }
+
+    var rawValue: Int {
+      get {
+        switch self {
+        case .idempotencyUnknown: return 0
+        case .noSideEffects: return 1
+        case .idempotent: return 2
+        }
+      }
+    }
+
+    var json: String {
+      get {
+        switch self {
+        case .idempotencyUnknown: return "\"IDEMPOTENCY_UNKNOWN\""
+        case .noSideEffects: return "\"NO_SIDE_EFFECTS\""
+        case .idempotent: return "\"IDEMPOTENT\""
+        }
+      }
+    }
+
+    var hashValue: Int { return rawValue }
+
+    var debugDescription: String {
+      get {
+        switch self {
+        case .idempotencyUnknown: return ".idempotencyUnknown"
+        case .noSideEffects: return ".noSideEffects"
+        case .idempotent: return ".idempotent"
+        }
+      }
+    }
+
+  }
+
   //  Note:  Field numbers 1 through 32 are reserved for Google's internal RPC
   //    framework.  We apologize for hoarding these numbers to ourselves, but
   //    we were already using them long before we decided to release Protocol
@@ -3371,6 +3448,18 @@ struct Google_Protobuf_MethodOptions: ProtobufGeneratedMessage, ProtobufProto2Me
     return _deprecated = nil
   }
 
+  private var _idempotencyLevel: Google_Protobuf_MethodOptions.IdempotencyLevel? = nil
+  var idempotencyLevel: Google_Protobuf_MethodOptions.IdempotencyLevel {
+    get {return _idempotencyLevel ?? Google_Protobuf_MethodOptions.IdempotencyLevel.idempotencyUnknown}
+    set {_idempotencyLevel = newValue}
+  }
+  public var hasIdempotencyLevel: Bool {
+    return _idempotencyLevel != nil
+  }
+  public mutating func clearIdempotencyLevel() {
+    return _idempotencyLevel = nil
+  }
+
   ///   The parser stores options it doesn't recognize here. See above.
   var uninterpretedOption: [Google_Protobuf_UninterpretedOption] = []
 
@@ -3379,6 +3468,7 @@ struct Google_Protobuf_MethodOptions: ProtobufGeneratedMessage, ProtobufProto2Me
   public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
     switch protoFieldNumber {
     case 33: try setter.decodeSingularField(fieldType: ProtobufBool.self, value: &_deprecated)
+    case 34: try setter.decodeSingularField(fieldType: Google_Protobuf_MethodOptions.IdempotencyLevel.self, value: &_idempotencyLevel)
     case 999: try setter.decodeRepeatedMessageField(fieldType: Google_Protobuf_UninterpretedOption.self, value: &uninterpretedOption)
     default: if (1000 <= protoFieldNumber && protoFieldNumber < 536870912) {
         try setter.decodeExtensionField(values: &extensionFieldValues, messageType: Google_Protobuf_MethodOptions.self, protoFieldNumber: protoFieldNumber)
@@ -3390,6 +3480,9 @@ struct Google_Protobuf_MethodOptions: ProtobufGeneratedMessage, ProtobufProto2Me
     if let v = _deprecated {
       try visitor.visitSingularField(fieldType: ProtobufBool.self, value: v, protoFieldNumber: 33)
     }
+    if let v = _idempotencyLevel {
+      try visitor.visitSingularField(fieldType: Google_Protobuf_MethodOptions.IdempotencyLevel.self, value: v, protoFieldNumber: 34)
+    }
     if !uninterpretedOption.isEmpty {
       try visitor.visitRepeatedMessageField(value: uninterpretedOption, protoFieldNumber: 999)
     }
@@ -3399,6 +3492,7 @@ struct Google_Protobuf_MethodOptions: ProtobufGeneratedMessage, ProtobufProto2Me
 
   public func _protoc_generated_isEqualTo(other: Google_Protobuf_MethodOptions) -> Bool {
     if (((_deprecated != nil && _deprecated! != false) || (other._deprecated != nil && other._deprecated! != false)) && (_deprecated == nil || other._deprecated == nil || _deprecated! != other._deprecated!)) {return false}
+    if (((_idempotencyLevel != nil && _idempotencyLevel! != Google_Protobuf_MethodOptions.IdempotencyLevel.idempotencyUnknown) || (other._idempotencyLevel != nil && other._idempotencyLevel! != Google_Protobuf_MethodOptions.IdempotencyLevel.idempotencyUnknown)) && (_idempotencyLevel == nil || other._idempotencyLevel == nil || _idempotencyLevel! != other._idempotencyLevel!)) {return false}
     if uninterpretedOption != other.uninterpretedOption {return false}
     if unknown != other.unknown {return false}
     if extensionFieldValues != other.extensionFieldValues {return false}

+ 605 - 0
Tests/SwiftProtobufTests/unittest.pb.swift

@@ -8794,6 +8794,584 @@ struct ProtobufUnittest_BarResponse: ProtobufGeneratedMessage, ProtobufProto2Mes
   }
 }
 
+struct ProtobufUnittest_TestJsonName: ProtobufGeneratedMessage, ProtobufProto2Message, ProtoNameProviding {
+  public var swiftClassName: String {return "ProtobufUnittest_TestJsonName"}
+  public var protoMessageName: String {return "TestJsonName"}
+  public var protoPackageName: String {return "protobuf_unittest"}
+  public static let _protobuf_fieldNames: FieldNameMap = [
+    1: .unique(proto: "field_name1", json: "fieldName1", swift: "fieldName1"),
+    2: .same(proto: "fieldName2", swift: "fieldName2"),
+    3: .same(proto: "FieldName3", swift: "fieldName3"),
+    4: .unique(proto: "_field_name4", json: "FieldName4", swift: "fieldName4"),
+    5: .unique(proto: "FIELD_NAME5", json: "FIELDNAME5", swift: "fieldName5"),
+    6: .unique(proto: "field_name6", json: "@type", swift: "fieldName6"),
+  ]
+
+  public var unknown = ProtobufUnknownStorage()
+
+  private var _fieldName1: Int32? = nil
+  var fieldName1: Int32 {
+    get {return _fieldName1 ?? 0}
+    set {_fieldName1 = newValue}
+  }
+  public var hasFieldName1: Bool {
+    return _fieldName1 != nil
+  }
+  public mutating func clearFieldName1() {
+    return _fieldName1 = nil
+  }
+
+  private var _fieldName2: Int32? = nil
+  var fieldName2: Int32 {
+    get {return _fieldName2 ?? 0}
+    set {_fieldName2 = newValue}
+  }
+  public var hasFieldName2: Bool {
+    return _fieldName2 != nil
+  }
+  public mutating func clearFieldName2() {
+    return _fieldName2 = nil
+  }
+
+  private var _fieldName3: Int32? = nil
+  var fieldName3: Int32 {
+    get {return _fieldName3 ?? 0}
+    set {_fieldName3 = newValue}
+  }
+  public var hasFieldName3: Bool {
+    return _fieldName3 != nil
+  }
+  public mutating func clearFieldName3() {
+    return _fieldName3 = nil
+  }
+
+  private var _fieldName4: Int32? = nil
+  var fieldName4: Int32 {
+    get {return _fieldName4 ?? 0}
+    set {_fieldName4 = newValue}
+  }
+  public var hasFieldName4: Bool {
+    return _fieldName4 != nil
+  }
+  public mutating func clearFieldName4() {
+    return _fieldName4 = nil
+  }
+
+  private var _fieldName5: Int32? = nil
+  var fieldName5: Int32 {
+    get {return _fieldName5 ?? 0}
+    set {_fieldName5 = newValue}
+  }
+  public var hasFieldName5: Bool {
+    return _fieldName5 != nil
+  }
+  public mutating func clearFieldName5() {
+    return _fieldName5 = nil
+  }
+
+  private var _fieldName6: Int32? = nil
+  var fieldName6: Int32 {
+    get {return _fieldName6 ?? 0}
+    set {_fieldName6 = newValue}
+  }
+  public var hasFieldName6: Bool {
+    return _fieldName6 != nil
+  }
+  public mutating func clearFieldName6() {
+    return _fieldName6 = nil
+  }
+
+  init() {}
+
+  public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+    switch protoFieldNumber {
+    case 1: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName1)
+    case 2: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName2)
+    case 3: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName3)
+    case 4: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName4)
+    case 5: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName5)
+    case 6: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fieldName6)
+    default: break
+    }
+  }
+
+  public func _protoc_generated_traverse(visitor: inout ProtobufVisitor) throws {
+    if let v = _fieldName1 {
+      try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 1)
+    }
+    if let v = _fieldName2 {
+      try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 2)
+    }
+    if let v = _fieldName3 {
+      try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 3)
+    }
+    if let v = _fieldName4 {
+      try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 4)
+    }
+    if let v = _fieldName5 {
+      try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 5)
+    }
+    if let v = _fieldName6 {
+      try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 6)
+    }
+    unknown.traverse(visitor: &visitor)
+  }
+
+  public func _protoc_generated_isEqualTo(other: ProtobufUnittest_TestJsonName) -> Bool {
+    if (fieldName1 != other.fieldName1) {return false}
+    if (fieldName2 != other.fieldName2) {return false}
+    if (fieldName3 != other.fieldName3) {return false}
+    if (fieldName4 != other.fieldName4) {return false}
+    if (fieldName5 != other.fieldName5) {return false}
+    if (fieldName6 != other.fieldName6) {return false}
+    if unknown != other.unknown {return false}
+    return true
+  }
+}
+
+struct ProtobufUnittest_TestHugeFieldNumbers: ProtobufGeneratedMessage, ProtobufProto2Message, ProtobufExtensibleMessage, ProtoNameProviding {
+  public var swiftClassName: String {return "ProtobufUnittest_TestHugeFieldNumbers"}
+  public var protoMessageName: String {return "TestHugeFieldNumbers"}
+  public var protoPackageName: String {return "protobuf_unittest"}
+  public static let _protobuf_fieldNames: FieldNameMap = [
+    536870000: .unique(proto: "optional_int32", json: "optionalInt32", swift: "optionalInt32"),
+    536870001: .unique(proto: "fixed_32", json: "fixed32", swift: "fixed32"),
+    536870002: .unique(proto: "repeated_int32", json: "repeatedInt32", swift: "repeatedInt32"),
+    536870003: .unique(proto: "packed_int32", json: "packedInt32", swift: "packedInt32"),
+    536870004: .unique(proto: "optional_enum", json: "optionalEnum", swift: "optionalEnum"),
+    536870005: .unique(proto: "optional_string", json: "optionalString", swift: "optionalString"),
+    536870006: .unique(proto: "optional_bytes", json: "optionalBytes", swift: "optionalBytes"),
+    536870007: .unique(proto: "optional_message", json: "optionalMessage", swift: "optionalMessage"),
+    536870008: .same(proto: "optionalgroup", swift: "optionalGroup"),
+    536870010: .unique(proto: "string_string_map", json: "stringStringMap", swift: "stringStringMap"),
+    536870011: .unique(proto: "oneof_uint32", json: "oneofUint32", swift: "oneofUint32"),
+    536870012: .unique(proto: "oneof_test_all_types", json: "oneofTestAllTypes", swift: "oneofTestAllTypes"),
+    536870013: .unique(proto: "oneof_string", json: "oneofString", swift: "oneofString"),
+    536870014: .unique(proto: "oneof_bytes", json: "oneofBytes", swift: "oneofBytes"),
+  ]
+
+  private class _StorageClass: ProtobufExtensibleMessageStorage {
+    typealias ProtobufExtendedMessage = ProtobufUnittest_TestHugeFieldNumbers
+    var extensionFieldValues = ProtobufExtensionFieldValueSet()
+    var unknown = ProtobufUnknownStorage()
+    var _optionalInt32: Int32? = nil
+    var _fixed32: Int32? = nil
+    var _repeatedInt32: [Int32] = []
+    var _packedInt32: [Int32] = []
+    var _optionalEnum: ProtobufUnittest_ForeignEnum? = nil
+    var _optionalString: String? = nil
+    var _optionalBytes: Data? = nil
+    var _optionalMessage: ProtobufUnittest_ForeignMessage? = nil
+    var _optionalGroup: ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup? = nil
+    var _stringStringMap: Dictionary<String,String> = [:]
+    var _oneofField = ProtobufUnittest_TestHugeFieldNumbers.OneOf_OneofField()
+
+    init() {}
+
+    func decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+      switch protoFieldNumber {
+      case 536870000: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_optionalInt32)
+      case 536870001: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fixed32)
+      case 536870002: try setter.decodeRepeatedField(fieldType: ProtobufInt32.self, value: &_repeatedInt32)
+      case 536870003: try setter.decodePackedField(fieldType: ProtobufInt32.self, value: &_packedInt32)
+      case 536870004: try setter.decodeSingularField(fieldType: ProtobufUnittest_ForeignEnum.self, value: &_optionalEnum)
+      case 536870005: try setter.decodeSingularField(fieldType: ProtobufString.self, value: &_optionalString)
+      case 536870006: try setter.decodeSingularField(fieldType: ProtobufBytes.self, value: &_optionalBytes)
+      case 536870007: try setter.decodeSingularMessageField(fieldType: ProtobufUnittest_ForeignMessage.self, value: &_optionalMessage)
+      case 536870008: try setter.decodeSingularGroupField(fieldType: ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup.self, value: &_optionalGroup)
+      case 536870010: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufString,ProtobufString>.self, value: &_stringStringMap)
+      case 536870011, 536870012, 536870013, 536870014: try _oneofField.decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+      default: if (536860000 <= protoFieldNumber && protoFieldNumber < 536870000) {
+          try setter.decodeExtensionField(values: &extensionFieldValues, messageType: ProtobufUnittest_TestHugeFieldNumbers.self, protoFieldNumber: protoFieldNumber)
+        }
+      }
+    }
+
+    func traverse(visitor: inout ProtobufVisitor) throws {
+      try extensionFieldValues.traverse(visitor: &visitor, start: 536860000, end: 536870000)
+      if let v = _optionalInt32 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 536870000)
+      }
+      if let v = _fixed32 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 536870001)
+      }
+      if !_repeatedInt32.isEmpty {
+        try visitor.visitRepeatedField(fieldType: ProtobufInt32.self, value: _repeatedInt32, protoFieldNumber: 536870002)
+      }
+      if !_packedInt32.isEmpty {
+        try visitor.visitPackedField(fieldType: ProtobufInt32.self, value: _packedInt32, protoFieldNumber: 536870003)
+      }
+      if let v = _optionalEnum {
+        try visitor.visitSingularField(fieldType: ProtobufUnittest_ForeignEnum.self, value: v, protoFieldNumber: 536870004)
+      }
+      if let v = _optionalString {
+        try visitor.visitSingularField(fieldType: ProtobufString.self, value: v, protoFieldNumber: 536870005)
+      }
+      if let v = _optionalBytes {
+        try visitor.visitSingularField(fieldType: ProtobufBytes.self, value: v, protoFieldNumber: 536870006)
+      }
+      if let v = _optionalMessage {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 536870007)
+      }
+      if let v = _optionalGroup {
+        try visitor.visitSingularGroupField(value: v, protoFieldNumber: 536870008)
+      }
+      if !_stringStringMap.isEmpty {
+        try visitor.visitMapField(fieldType: ProtobufMap<ProtobufString,ProtobufString>.self, value: _stringStringMap, protoFieldNumber: 536870010)
+      }
+      try _oneofField.traverse(visitor: &visitor, start: 536870011, end: 536870015)
+      unknown.traverse(visitor: &visitor)
+    }
+
+    func isEqualTo(other: _StorageClass) -> Bool {
+      if (_optionalInt32 != other._optionalInt32) {return false}
+      if (_fixed32 != other._fixed32) {return false}
+      if _repeatedInt32 != other._repeatedInt32 {return false}
+      if _packedInt32 != other._packedInt32 {return false}
+      if (_optionalEnum != other._optionalEnum) {return false}
+      if (_optionalString != other._optionalString) {return false}
+      if (_optionalBytes != other._optionalBytes) {return false}
+      if ((_optionalMessage != nil || other._optionalMessage != nil) && (_optionalMessage == nil || other._optionalMessage == nil || _optionalMessage! != other._optionalMessage!)) {return false}
+      if ((_optionalGroup != nil || other._optionalGroup != nil) && (_optionalGroup == nil || other._optionalGroup == nil || _optionalGroup! != other._optionalGroup!)) {return false}
+      if _stringStringMap != other._stringStringMap {return false}
+      if _oneofField != other._oneofField {return false}
+      if unknown != other.unknown {return false}
+      if extensionFieldValues != other.extensionFieldValues {return false}
+      return true
+    }
+
+    func copy() -> _StorageClass {
+      let clone = _StorageClass()
+      clone.unknown = unknown
+      clone.extensionFieldValues = extensionFieldValues
+      clone._optionalInt32 = _optionalInt32
+      clone._fixed32 = _fixed32
+      clone._repeatedInt32 = _repeatedInt32
+      clone._packedInt32 = _packedInt32
+      clone._optionalEnum = _optionalEnum
+      clone._optionalString = _optionalString
+      clone._optionalBytes = _optionalBytes
+      clone._optionalMessage = _optionalMessage
+      clone._optionalGroup = _optionalGroup
+      clone._stringStringMap = _stringStringMap
+      clone._oneofField = _oneofField
+      return clone
+    }
+  }
+
+  private var _storage = _StorageClass()
+
+  public var unknown: ProtobufUnknownStorage {
+    get {return _storage.unknown}
+    set {_storage.unknown = newValue}
+  }
+
+  enum OneOf_OneofField: ExpressibleByNilLiteral, ProtobufOneofEnum {
+    case oneofUint32(UInt32)
+    case oneofTestAllTypes(ProtobufUnittest_TestAllTypes)
+    case oneofString(String)
+    case oneofBytes(Data)
+    case None
+
+    public init(nilLiteral: ()) {
+      self = .None
+    }
+
+    public init() {
+      self = .None
+    }
+
+    public mutating func decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+      if self != .None && setter.rejectConflictingOneof {
+        throw ProtobufDecodingError.duplicatedOneOf
+      }
+      switch protoFieldNumber {
+      case 536870011:
+        var value: UInt32?
+        try setter.decodeSingularField(fieldType: ProtobufUInt32.self, value: &value)
+        if let value = value {
+          self = .oneofUint32(value)
+        }
+      case 536870012:
+        var value: ProtobufUnittest_TestAllTypes?
+        try setter.decodeSingularMessageField(fieldType: ProtobufUnittest_TestAllTypes.self, value: &value)
+        if let value = value {
+          self = .oneofTestAllTypes(value)
+        }
+      case 536870013:
+        var value: String?
+        try setter.decodeSingularField(fieldType: ProtobufString.self, value: &value)
+        if let value = value {
+          self = .oneofString(value)
+        }
+      case 536870014:
+        var value: Data?
+        try setter.decodeSingularField(fieldType: ProtobufBytes.self, value: &value)
+        if let value = value {
+          self = .oneofBytes(value)
+        }
+      default:
+        self = .None
+      }
+    }
+
+    public func traverse(visitor: inout ProtobufVisitor, start: Int, end: Int) throws {
+      switch self {
+      case .oneofUint32(let v):
+        if start <= 536870011 && 536870011 < end {
+          try visitor.visitSingularField(fieldType: ProtobufUInt32.self, value: v, protoFieldNumber: 536870011)
+        }
+      case .oneofTestAllTypes(let v):
+        if start <= 536870012 && 536870012 < end {
+          try visitor.visitSingularMessageField(value: v, protoFieldNumber: 536870012)
+        }
+      case .oneofString(let v):
+        if start <= 536870013 && 536870013 < end {
+          try visitor.visitSingularField(fieldType: ProtobufString.self, value: v, protoFieldNumber: 536870013)
+        }
+      case .oneofBytes(let v):
+        if start <= 536870014 && 536870014 < end {
+          try visitor.visitSingularField(fieldType: ProtobufBytes.self, value: v, protoFieldNumber: 536870014)
+        }
+      case .None:
+        break
+      }
+    }
+  }
+
+  struct OptionalGroup: ProtobufGeneratedMessage, ProtobufProto2Message, ProtoNameProviding {
+    public var swiftClassName: String {return "ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup"}
+    public var protoMessageName: String {return "OptionalGroup"}
+    public var protoPackageName: String {return "protobuf_unittest"}
+    public static let _protobuf_fieldNames: FieldNameMap = [
+      536870009: .unique(proto: "group_a", json: "groupA", swift: "groupA"),
+    ]
+
+    public var unknown = ProtobufUnknownStorage()
+
+    private var _groupA: Int32? = nil
+    var groupA: Int32 {
+      get {return _groupA ?? 0}
+      set {_groupA = newValue}
+    }
+    public var hasGroupA: Bool {
+      return _groupA != nil
+    }
+    public mutating func clearGroupA() {
+      return _groupA = nil
+    }
+
+    init() {}
+
+    public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+      switch protoFieldNumber {
+      case 536870009: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_groupA)
+      default: break
+      }
+    }
+
+    public func _protoc_generated_traverse(visitor: inout ProtobufVisitor) throws {
+      if let v = _groupA {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 536870009)
+      }
+      unknown.traverse(visitor: &visitor)
+    }
+
+    public func _protoc_generated_isEqualTo(other: ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup) -> Bool {
+      if (groupA != other.groupA) {return false}
+      if unknown != other.unknown {return false}
+      return true
+    }
+  }
+
+  var optionalInt32: Int32 {
+    get {return _storage._optionalInt32 ?? 0}
+    set {_uniqueStorage()._optionalInt32 = newValue}
+  }
+  public var hasOptionalInt32: Bool {
+    return _storage._optionalInt32 != nil
+  }
+  public mutating func clearOptionalInt32() {
+    return _storage._optionalInt32 = nil
+  }
+
+  var fixed32: Int32 {
+    get {return _storage._fixed32 ?? 0}
+    set {_uniqueStorage()._fixed32 = newValue}
+  }
+  public var hasFixed32: Bool {
+    return _storage._fixed32 != nil
+  }
+  public mutating func clearFixed32() {
+    return _storage._fixed32 = nil
+  }
+
+  var repeatedInt32: [Int32] {
+    get {return _storage._repeatedInt32}
+    set {_uniqueStorage()._repeatedInt32 = newValue}
+  }
+
+  var packedInt32: [Int32] {
+    get {return _storage._packedInt32}
+    set {_uniqueStorage()._packedInt32 = newValue}
+  }
+
+  var optionalEnum: ProtobufUnittest_ForeignEnum {
+    get {return _storage._optionalEnum ?? ProtobufUnittest_ForeignEnum.foreignFoo}
+    set {_uniqueStorage()._optionalEnum = newValue}
+  }
+  public var hasOptionalEnum: Bool {
+    return _storage._optionalEnum != nil
+  }
+  public mutating func clearOptionalEnum() {
+    return _storage._optionalEnum = nil
+  }
+
+  var optionalString: String {
+    get {return _storage._optionalString ?? ""}
+    set {_uniqueStorage()._optionalString = newValue}
+  }
+  public var hasOptionalString: Bool {
+    return _storage._optionalString != nil
+  }
+  public mutating func clearOptionalString() {
+    return _storage._optionalString = nil
+  }
+
+  var optionalBytes: Data {
+    get {return _storage._optionalBytes ?? Data()}
+    set {_uniqueStorage()._optionalBytes = newValue}
+  }
+  public var hasOptionalBytes: Bool {
+    return _storage._optionalBytes != nil
+  }
+  public mutating func clearOptionalBytes() {
+    return _storage._optionalBytes = nil
+  }
+
+  var optionalMessage: ProtobufUnittest_ForeignMessage {
+    get {return _storage._optionalMessage ?? ProtobufUnittest_ForeignMessage()}
+    set {_uniqueStorage()._optionalMessage = newValue}
+  }
+  public var hasOptionalMessage: Bool {
+    return _storage._optionalMessage != nil
+  }
+  public mutating func clearOptionalMessage() {
+    return _storage._optionalMessage = nil
+  }
+
+  var optionalGroup: ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup {
+    get {return _storage._optionalGroup ?? ProtobufUnittest_TestHugeFieldNumbers.OptionalGroup()}
+    set {_uniqueStorage()._optionalGroup = newValue}
+  }
+  public var hasOptionalGroup: Bool {
+    return _storage._optionalGroup != nil
+  }
+  public mutating func clearOptionalGroup() {
+    return _storage._optionalGroup = nil
+  }
+
+  var stringStringMap: Dictionary<String,String> {
+    get {return _storage._stringStringMap}
+    set {_uniqueStorage()._stringStringMap = newValue}
+  }
+
+  var oneofUint32: UInt32 {
+    get {
+      if case .oneofUint32(let v) = _storage._oneofField {
+        return v
+      }
+      return 0
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofUint32(newValue)
+    }
+  }
+
+  var oneofTestAllTypes: ProtobufUnittest_TestAllTypes {
+    get {
+      if case .oneofTestAllTypes(let v) = _storage._oneofField {
+        return v
+      }
+      return ProtobufUnittest_TestAllTypes()
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofTestAllTypes(newValue)
+    }
+  }
+
+  var oneofString: String {
+    get {
+      if case .oneofString(let v) = _storage._oneofField {
+        return v
+      }
+      return ""
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofString(newValue)
+    }
+  }
+
+  var oneofBytes: Data {
+    get {
+      if case .oneofBytes(let v) = _storage._oneofField {
+        return v
+      }
+      return Data()
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofBytes(newValue)
+    }
+  }
+
+  public var oneofField: OneOf_OneofField {
+    get {return _storage._oneofField}
+    set {
+      _uniqueStorage()._oneofField = newValue
+    }
+  }
+
+  init() {}
+
+  public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+    try _uniqueStorage().decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+  }
+
+  public func _protoc_generated_traverse(visitor: inout ProtobufVisitor) throws {
+    try _storage.traverse(visitor: &visitor)
+  }
+
+  public func _protoc_generated_isEqualTo(other: ProtobufUnittest_TestHugeFieldNumbers) -> Bool {
+    return _storage === other._storage || _storage.isEqualTo(other: other._storage)
+  }
+
+  private mutating func _uniqueStorage() -> _StorageClass {
+    if !isKnownUniquelyReferenced(&_storage) {
+      _storage = _storage.copy()
+    }
+    return _storage
+  }
+
+  public mutating func setExtensionValue<F: ProtobufExtensionField>(ext: ProtobufGenericMessageExtension<F, ProtobufUnittest_TestHugeFieldNumbers>, value: F.ValueType) {
+    return _uniqueStorage().setExtensionValue(ext: ext, value: value)
+  }
+
+  public mutating func clearExtensionValue<F: ProtobufExtensionField>(ext: ProtobufGenericMessageExtension<F, ProtobufUnittest_TestHugeFieldNumbers>) {
+    return _storage.clearExtensionValue(ext: ext)
+  }
+
+  public func getExtensionValue<F: ProtobufExtensionField>(ext: ProtobufGenericMessageExtension<F, ProtobufUnittest_TestHugeFieldNumbers>) -> F.ValueType {
+    return _storage.getExtensionValue(ext: ext)
+  }
+
+  public func hasExtensionValue<F: ProtobufExtensionField>(ext: ProtobufGenericMessageExtension<F, ProtobufUnittest_TestHugeFieldNumbers>) -> Bool {
+    return _storage.hasExtensionValue(ext: ext)
+  }
+  public func _protobuf_fieldNames(for number: Int) -> FieldNameMap.Names? {
+    return ProtobufUnittest_TestHugeFieldNumbers._protobuf_fieldNames.fieldNames(for: number) ?? _storage.extensionFieldValues.fieldNames(for: number)
+  }
+}
+
 ///   Singular
 let ProtobufUnittest_Extensions_optionalInt32Extension = ProtobufGenericMessageExtension<ProtobufOptionalField<ProtobufInt32>, ProtobufUnittest_TestAllExtensions>(protoFieldNumber: 1, fieldNames: .unique(proto: "optional_int32_extension", json: "optionalInt32Extension", swift: "ProtobufUnittest_optionalInt32Extension"), defaultValue: 0)
 
@@ -9008,6 +9586,8 @@ let ProtobufUnittest_Extensions_unpackedBoolExtension = ProtobufGenericMessageEx
 
 let ProtobufUnittest_Extensions_unpackedEnumExtension = ProtobufGenericMessageExtension<ProtobufRepeatedField<ProtobufUnittest_ForeignEnum>, ProtobufUnittest_TestUnpackedExtensions>(protoFieldNumber: 103, fieldNames: .unique(proto: "unpacked_enum_extension", json: "unpackedEnumExtension", swift: "ProtobufUnittest_unpackedEnumExtension"), defaultValue: [])
 
+let ProtobufUnittest_Extensions_testAllTypes = ProtobufGenericMessageExtension<ProtobufOptionalMessageField<ProtobufUnittest_TestAllTypes>, ProtobufUnittest_TestHugeFieldNumbers>(protoFieldNumber: 536860000, fieldNames: .unique(proto: "test_all_types", json: "testAllTypes", swift: "ProtobufUnittest_testAllTypes"), defaultValue: ProtobufUnittest_TestAllTypes())
+
 func ==(lhs: ProtobufUnittest_TestAllTypes.OneOf_OneofField, rhs: ProtobufUnittest_TestAllTypes.OneOf_OneofField) -> Bool {
   switch (lhs, rhs) {
   case (.oneofUint32(let l), .oneofUint32(let r)): return l == r
@@ -9151,6 +9731,17 @@ extension ProtobufUnittest_TestParsingMerge {
   }
 }
 
+func ==(lhs: ProtobufUnittest_TestHugeFieldNumbers.OneOf_OneofField, rhs: ProtobufUnittest_TestHugeFieldNumbers.OneOf_OneofField) -> Bool {
+  switch (lhs, rhs) {
+  case (.oneofUint32(let l), .oneofUint32(let r)): return l == r
+  case (.oneofTestAllTypes(let l), .oneofTestAllTypes(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 (.None, .None): return true
+  default: return false
+  }
+}
+
 extension ProtobufUnittest_TestAllExtensions {
   ///   Singular
   var ProtobufUnittest_optionalInt32Extension: Int32 {
@@ -10520,6 +11111,19 @@ extension ProtobufUnittest_TestUnpackedExtensions {
   }
 }
 
+extension ProtobufUnittest_TestHugeFieldNumbers {
+  var ProtobufUnittest_testAllTypes: ProtobufUnittest_TestAllTypes {
+    get {return getExtensionValue(ext: ProtobufUnittest_Extensions_testAllTypes) ?? ProtobufUnittest_TestAllTypes()}
+    set {setExtensionValue(ext: ProtobufUnittest_Extensions_testAllTypes, value: newValue)}
+  }
+  var hasProtobufUnittest_testAllTypes: Bool {
+    return hasExtensionValue(ext: ProtobufUnittest_Extensions_testAllTypes)
+  }
+  mutating func clearProtobufUnittest_testAllTypes() {
+    clearExtensionValue(ext: ProtobufUnittest_Extensions_testAllTypes)
+  }
+}
+
 let ProtobufUnittest_Unittest_Extensions: ProtobufExtensionSet = [
   ProtobufUnittest_Extensions_optionalInt32Extension,
   ProtobufUnittest_Extensions_optionalInt64Extension,
@@ -10626,6 +11230,7 @@ let ProtobufUnittest_Unittest_Extensions: ProtobufExtensionSet = [
   ProtobufUnittest_Extensions_unpackedDoubleExtension,
   ProtobufUnittest_Extensions_unpackedBoolExtension,
   ProtobufUnittest_Extensions_unpackedEnumExtension,
+  ProtobufUnittest_Extensions_testAllTypes,
   ProtobufUnittest_TestNestedExtension.Extensions.test,
   ProtobufUnittest_TestNestedExtension.Extensions.nestedStringExtension,
   ProtobufUnittest_TestRequired.Extensions.single,

+ 490 - 0
Tests/SwiftProtobufTests/unittest_lite.pb.swift

@@ -342,6 +342,7 @@ struct ProtobufUnittest_TestAllTypesLite: ProtobufGeneratedMessage, ProtobufProt
     113: .unique(proto: "oneof_string", json: "oneofString", swift: "oneofString"),
     114: .unique(proto: "oneof_bytes", json: "oneofBytes", swift: "oneofBytes"),
     115: .unique(proto: "oneof_lazy_nested_message", json: "oneofLazyNestedMessage", swift: "oneofLazyNestedMessage"),
+    116: .unique(proto: "deceptively_named_list", json: "deceptivelyNamedList", swift: "deceptivelyNamedList"),
   ]
 
   private class _StorageClass {
@@ -419,6 +420,7 @@ struct ProtobufUnittest_TestAllTypesLite: ProtobufGeneratedMessage, ProtobufProt
     var _defaultStringPiece: String? = nil
     var _defaultCord: String? = nil
     var _oneofField = ProtobufUnittest_TestAllTypesLite.OneOf_OneofField()
+    var _deceptivelyNamedList: Int32? = nil
 
     init() {}
 
@@ -496,6 +498,7 @@ struct ProtobufUnittest_TestAllTypesLite: ProtobufGeneratedMessage, ProtobufProt
       case 84: try setter.decodeSingularField(fieldType: ProtobufString.self, value: &_defaultStringPiece)
       case 85: try setter.decodeSingularField(fieldType: ProtobufString.self, value: &_defaultCord)
       case 111, 112, 113, 114, 115: try _oneofField.decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+      case 116: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_deceptivelyNamedList)
       default: break
       }
     }
@@ -715,6 +718,9 @@ struct ProtobufUnittest_TestAllTypesLite: ProtobufGeneratedMessage, ProtobufProt
         try visitor.visitSingularField(fieldType: ProtobufString.self, value: v, protoFieldNumber: 85)
       }
       try _oneofField.traverse(visitor: &visitor, start: 111, end: 116)
+      if let v = _deceptivelyNamedList {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 116)
+      }
       unknown.traverse(visitor: &visitor)
     }
 
@@ -791,6 +797,7 @@ struct ProtobufUnittest_TestAllTypesLite: ProtobufGeneratedMessage, ProtobufProt
       if (((_defaultStringPiece != nil && _defaultStringPiece! != "abc") || (other._defaultStringPiece != nil && other._defaultStringPiece! != "abc")) && (_defaultStringPiece == nil || other._defaultStringPiece == nil || _defaultStringPiece! != other._defaultStringPiece!)) {return false}
       if (((_defaultCord != nil && _defaultCord! != "123") || (other._defaultCord != nil && other._defaultCord! != "123")) && (_defaultCord == nil || other._defaultCord == nil || _defaultCord! != other._defaultCord!)) {return false}
       if _oneofField != other._oneofField {return false}
+      if (_deceptivelyNamedList != other._deceptivelyNamedList) {return false}
       if unknown != other.unknown {return false}
       return true
     }
@@ -870,6 +877,7 @@ struct ProtobufUnittest_TestAllTypesLite: ProtobufGeneratedMessage, ProtobufProt
       clone._defaultStringPiece = _defaultStringPiece
       clone._defaultCord = _defaultCord
       clone._oneofField = _oneofField
+      clone._deceptivelyNamedList = _deceptivelyNamedList
       return clone
     }
   }
@@ -1893,6 +1901,18 @@ struct ProtobufUnittest_TestAllTypesLite: ProtobufGeneratedMessage, ProtobufProt
     }
   }
 
+  ///   Tests toString for non-repeated fields with a list suffix
+  var deceptivelyNamedList: Int32 {
+    get {return _storage._deceptivelyNamedList ?? 0}
+    set {_uniqueStorage()._deceptivelyNamedList = newValue}
+  }
+  public var hasDeceptivelyNamedList: Bool {
+    return _storage._deceptivelyNamedList != nil
+  }
+  public mutating func clearDeceptivelyNamedList() {
+    return _storage._deceptivelyNamedList = nil
+  }
+
   public var oneofField: OneOf_OneofField {
     get {return _storage._oneofField}
     set {
@@ -3170,6 +3190,449 @@ struct ProtobufUnittest_V2MessageLite: ProtobufGeneratedMessage, ProtobufProto2M
   }
 }
 
+struct ProtobufUnittest_TestHugeFieldNumbersLite: ProtobufGeneratedMessage, ProtobufProto2Message, ProtobufExtensibleMessage, ProtoNameProviding {
+  public var swiftClassName: String {return "ProtobufUnittest_TestHugeFieldNumbersLite"}
+  public var protoMessageName: String {return "TestHugeFieldNumbersLite"}
+  public var protoPackageName: String {return "protobuf_unittest"}
+  public static let _protobuf_fieldNames: FieldNameMap = [
+    536870000: .unique(proto: "optional_int32", json: "optionalInt32", swift: "optionalInt32"),
+    536870001: .unique(proto: "fixed_32", json: "fixed32", swift: "fixed32"),
+    536870002: .unique(proto: "repeated_int32", json: "repeatedInt32", swift: "repeatedInt32"),
+    536870003: .unique(proto: "packed_int32", json: "packedInt32", swift: "packedInt32"),
+    536870004: .unique(proto: "optional_enum", json: "optionalEnum", swift: "optionalEnum"),
+    536870005: .unique(proto: "optional_string", json: "optionalString", swift: "optionalString"),
+    536870006: .unique(proto: "optional_bytes", json: "optionalBytes", swift: "optionalBytes"),
+    536870007: .unique(proto: "optional_message", json: "optionalMessage", swift: "optionalMessage"),
+    536870008: .same(proto: "optionalgroup", swift: "optionalGroup"),
+    536870010: .unique(proto: "string_string_map", json: "stringStringMap", swift: "stringStringMap"),
+    536870011: .unique(proto: "oneof_uint32", json: "oneofUint32", swift: "oneofUint32"),
+    536870012: .unique(proto: "oneof_test_all_types", json: "oneofTestAllTypes", swift: "oneofTestAllTypes"),
+    536870013: .unique(proto: "oneof_string", json: "oneofString", swift: "oneofString"),
+    536870014: .unique(proto: "oneof_bytes", json: "oneofBytes", swift: "oneofBytes"),
+  ]
+
+  private class _StorageClass: ProtobufExtensibleMessageStorage {
+    typealias ProtobufExtendedMessage = ProtobufUnittest_TestHugeFieldNumbersLite
+    var extensionFieldValues = ProtobufExtensionFieldValueSet()
+    var unknown = ProtobufUnknownStorage()
+    var _optionalInt32: Int32? = nil
+    var _fixed32: Int32? = nil
+    var _repeatedInt32: [Int32] = []
+    var _packedInt32: [Int32] = []
+    var _optionalEnum: ProtobufUnittest_ForeignEnumLite? = nil
+    var _optionalString: String? = nil
+    var _optionalBytes: Data? = nil
+    var _optionalMessage: ProtobufUnittest_ForeignMessageLite? = nil
+    var _optionalGroup: ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup? = nil
+    var _stringStringMap: Dictionary<String,String> = [:]
+    var _oneofField = ProtobufUnittest_TestHugeFieldNumbersLite.OneOf_OneofField()
+
+    init() {}
+
+    func decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+      switch protoFieldNumber {
+      case 536870000: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_optionalInt32)
+      case 536870001: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_fixed32)
+      case 536870002: try setter.decodeRepeatedField(fieldType: ProtobufInt32.self, value: &_repeatedInt32)
+      case 536870003: try setter.decodePackedField(fieldType: ProtobufInt32.self, value: &_packedInt32)
+      case 536870004: try setter.decodeSingularField(fieldType: ProtobufUnittest_ForeignEnumLite.self, value: &_optionalEnum)
+      case 536870005: try setter.decodeSingularField(fieldType: ProtobufString.self, value: &_optionalString)
+      case 536870006: try setter.decodeSingularField(fieldType: ProtobufBytes.self, value: &_optionalBytes)
+      case 536870007: try setter.decodeSingularMessageField(fieldType: ProtobufUnittest_ForeignMessageLite.self, value: &_optionalMessage)
+      case 536870008: try setter.decodeSingularGroupField(fieldType: ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup.self, value: &_optionalGroup)
+      case 536870010: try setter.decodeMapField(fieldType: ProtobufMap<ProtobufString,ProtobufString>.self, value: &_stringStringMap)
+      case 536870011, 536870012, 536870013, 536870014: try _oneofField.decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+      default: if (536860000 <= protoFieldNumber && protoFieldNumber < 536870000) {
+          try setter.decodeExtensionField(values: &extensionFieldValues, messageType: ProtobufUnittest_TestHugeFieldNumbersLite.self, protoFieldNumber: protoFieldNumber)
+        }
+      }
+    }
+
+    func traverse(visitor: inout ProtobufVisitor) throws {
+      try extensionFieldValues.traverse(visitor: &visitor, start: 536860000, end: 536870000)
+      if let v = _optionalInt32 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 536870000)
+      }
+      if let v = _fixed32 {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 536870001)
+      }
+      if !_repeatedInt32.isEmpty {
+        try visitor.visitRepeatedField(fieldType: ProtobufInt32.self, value: _repeatedInt32, protoFieldNumber: 536870002)
+      }
+      if !_packedInt32.isEmpty {
+        try visitor.visitPackedField(fieldType: ProtobufInt32.self, value: _packedInt32, protoFieldNumber: 536870003)
+      }
+      if let v = _optionalEnum {
+        try visitor.visitSingularField(fieldType: ProtobufUnittest_ForeignEnumLite.self, value: v, protoFieldNumber: 536870004)
+      }
+      if let v = _optionalString {
+        try visitor.visitSingularField(fieldType: ProtobufString.self, value: v, protoFieldNumber: 536870005)
+      }
+      if let v = _optionalBytes {
+        try visitor.visitSingularField(fieldType: ProtobufBytes.self, value: v, protoFieldNumber: 536870006)
+      }
+      if let v = _optionalMessage {
+        try visitor.visitSingularMessageField(value: v, protoFieldNumber: 536870007)
+      }
+      if let v = _optionalGroup {
+        try visitor.visitSingularGroupField(value: v, protoFieldNumber: 536870008)
+      }
+      if !_stringStringMap.isEmpty {
+        try visitor.visitMapField(fieldType: ProtobufMap<ProtobufString,ProtobufString>.self, value: _stringStringMap, protoFieldNumber: 536870010)
+      }
+      try _oneofField.traverse(visitor: &visitor, start: 536870011, end: 536870015)
+      unknown.traverse(visitor: &visitor)
+    }
+
+    func isEqualTo(other: _StorageClass) -> Bool {
+      if (_optionalInt32 != other._optionalInt32) {return false}
+      if (_fixed32 != other._fixed32) {return false}
+      if _repeatedInt32 != other._repeatedInt32 {return false}
+      if _packedInt32 != other._packedInt32 {return false}
+      if (_optionalEnum != other._optionalEnum) {return false}
+      if (_optionalString != other._optionalString) {return false}
+      if (_optionalBytes != other._optionalBytes) {return false}
+      if ((_optionalMessage != nil || other._optionalMessage != nil) && (_optionalMessage == nil || other._optionalMessage == nil || _optionalMessage! != other._optionalMessage!)) {return false}
+      if ((_optionalGroup != nil || other._optionalGroup != nil) && (_optionalGroup == nil || other._optionalGroup == nil || _optionalGroup! != other._optionalGroup!)) {return false}
+      if _stringStringMap != other._stringStringMap {return false}
+      if _oneofField != other._oneofField {return false}
+      if unknown != other.unknown {return false}
+      if extensionFieldValues != other.extensionFieldValues {return false}
+      return true
+    }
+
+    func copy() -> _StorageClass {
+      let clone = _StorageClass()
+      clone.unknown = unknown
+      clone.extensionFieldValues = extensionFieldValues
+      clone._optionalInt32 = _optionalInt32
+      clone._fixed32 = _fixed32
+      clone._repeatedInt32 = _repeatedInt32
+      clone._packedInt32 = _packedInt32
+      clone._optionalEnum = _optionalEnum
+      clone._optionalString = _optionalString
+      clone._optionalBytes = _optionalBytes
+      clone._optionalMessage = _optionalMessage
+      clone._optionalGroup = _optionalGroup
+      clone._stringStringMap = _stringStringMap
+      clone._oneofField = _oneofField
+      return clone
+    }
+  }
+
+  private var _storage = _StorageClass()
+
+  public var unknown: ProtobufUnknownStorage {
+    get {return _storage.unknown}
+    set {_storage.unknown = newValue}
+  }
+
+  enum OneOf_OneofField: ExpressibleByNilLiteral, ProtobufOneofEnum {
+    case oneofUint32(UInt32)
+    case oneofTestAllTypes(ProtobufUnittest_TestAllTypesLite)
+    case oneofString(String)
+    case oneofBytes(Data)
+    case None
+
+    public init(nilLiteral: ()) {
+      self = .None
+    }
+
+    public init() {
+      self = .None
+    }
+
+    public mutating func decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+      if self != .None && setter.rejectConflictingOneof {
+        throw ProtobufDecodingError.duplicatedOneOf
+      }
+      switch protoFieldNumber {
+      case 536870011:
+        var value: UInt32?
+        try setter.decodeSingularField(fieldType: ProtobufUInt32.self, value: &value)
+        if let value = value {
+          self = .oneofUint32(value)
+        }
+      case 536870012:
+        var value: ProtobufUnittest_TestAllTypesLite?
+        try setter.decodeSingularMessageField(fieldType: ProtobufUnittest_TestAllTypesLite.self, value: &value)
+        if let value = value {
+          self = .oneofTestAllTypes(value)
+        }
+      case 536870013:
+        var value: String?
+        try setter.decodeSingularField(fieldType: ProtobufString.self, value: &value)
+        if let value = value {
+          self = .oneofString(value)
+        }
+      case 536870014:
+        var value: Data?
+        try setter.decodeSingularField(fieldType: ProtobufBytes.self, value: &value)
+        if let value = value {
+          self = .oneofBytes(value)
+        }
+      default:
+        self = .None
+      }
+    }
+
+    public func traverse(visitor: inout ProtobufVisitor, start: Int, end: Int) throws {
+      switch self {
+      case .oneofUint32(let v):
+        if start <= 536870011 && 536870011 < end {
+          try visitor.visitSingularField(fieldType: ProtobufUInt32.self, value: v, protoFieldNumber: 536870011)
+        }
+      case .oneofTestAllTypes(let v):
+        if start <= 536870012 && 536870012 < end {
+          try visitor.visitSingularMessageField(value: v, protoFieldNumber: 536870012)
+        }
+      case .oneofString(let v):
+        if start <= 536870013 && 536870013 < end {
+          try visitor.visitSingularField(fieldType: ProtobufString.self, value: v, protoFieldNumber: 536870013)
+        }
+      case .oneofBytes(let v):
+        if start <= 536870014 && 536870014 < end {
+          try visitor.visitSingularField(fieldType: ProtobufBytes.self, value: v, protoFieldNumber: 536870014)
+        }
+      case .None:
+        break
+      }
+    }
+  }
+
+  struct OptionalGroup: ProtobufGeneratedMessage, ProtobufProto2Message, ProtoNameProviding {
+    public var swiftClassName: String {return "ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup"}
+    public var protoMessageName: String {return "OptionalGroup"}
+    public var protoPackageName: String {return "protobuf_unittest"}
+    public static let _protobuf_fieldNames: FieldNameMap = [
+      536870009: .unique(proto: "group_a", json: "groupA", swift: "groupA"),
+    ]
+
+    public var unknown = ProtobufUnknownStorage()
+
+    private var _groupA: Int32? = nil
+    var groupA: Int32 {
+      get {return _groupA ?? 0}
+      set {_groupA = newValue}
+    }
+    public var hasGroupA: Bool {
+      return _groupA != nil
+    }
+    public mutating func clearGroupA() {
+      return _groupA = nil
+    }
+
+    init() {}
+
+    public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+      switch protoFieldNumber {
+      case 536870009: try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &_groupA)
+      default: break
+      }
+    }
+
+    public func _protoc_generated_traverse(visitor: inout ProtobufVisitor) throws {
+      if let v = _groupA {
+        try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: v, protoFieldNumber: 536870009)
+      }
+      unknown.traverse(visitor: &visitor)
+    }
+
+    public func _protoc_generated_isEqualTo(other: ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup) -> Bool {
+      if (groupA != other.groupA) {return false}
+      if unknown != other.unknown {return false}
+      return true
+    }
+  }
+
+  var optionalInt32: Int32 {
+    get {return _storage._optionalInt32 ?? 0}
+    set {_uniqueStorage()._optionalInt32 = newValue}
+  }
+  public var hasOptionalInt32: Bool {
+    return _storage._optionalInt32 != nil
+  }
+  public mutating func clearOptionalInt32() {
+    return _storage._optionalInt32 = nil
+  }
+
+  var fixed32: Int32 {
+    get {return _storage._fixed32 ?? 0}
+    set {_uniqueStorage()._fixed32 = newValue}
+  }
+  public var hasFixed32: Bool {
+    return _storage._fixed32 != nil
+  }
+  public mutating func clearFixed32() {
+    return _storage._fixed32 = nil
+  }
+
+  var repeatedInt32: [Int32] {
+    get {return _storage._repeatedInt32}
+    set {_uniqueStorage()._repeatedInt32 = newValue}
+  }
+
+  var packedInt32: [Int32] {
+    get {return _storage._packedInt32}
+    set {_uniqueStorage()._packedInt32 = newValue}
+  }
+
+  var optionalEnum: ProtobufUnittest_ForeignEnumLite {
+    get {return _storage._optionalEnum ?? ProtobufUnittest_ForeignEnumLite.foreignLiteFoo}
+    set {_uniqueStorage()._optionalEnum = newValue}
+  }
+  public var hasOptionalEnum: Bool {
+    return _storage._optionalEnum != nil
+  }
+  public mutating func clearOptionalEnum() {
+    return _storage._optionalEnum = nil
+  }
+
+  var optionalString: String {
+    get {return _storage._optionalString ?? ""}
+    set {_uniqueStorage()._optionalString = newValue}
+  }
+  public var hasOptionalString: Bool {
+    return _storage._optionalString != nil
+  }
+  public mutating func clearOptionalString() {
+    return _storage._optionalString = nil
+  }
+
+  var optionalBytes: Data {
+    get {return _storage._optionalBytes ?? Data()}
+    set {_uniqueStorage()._optionalBytes = newValue}
+  }
+  public var hasOptionalBytes: Bool {
+    return _storage._optionalBytes != nil
+  }
+  public mutating func clearOptionalBytes() {
+    return _storage._optionalBytes = nil
+  }
+
+  var optionalMessage: ProtobufUnittest_ForeignMessageLite {
+    get {return _storage._optionalMessage ?? ProtobufUnittest_ForeignMessageLite()}
+    set {_uniqueStorage()._optionalMessage = newValue}
+  }
+  public var hasOptionalMessage: Bool {
+    return _storage._optionalMessage != nil
+  }
+  public mutating func clearOptionalMessage() {
+    return _storage._optionalMessage = nil
+  }
+
+  var optionalGroup: ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup {
+    get {return _storage._optionalGroup ?? ProtobufUnittest_TestHugeFieldNumbersLite.OptionalGroup()}
+    set {_uniqueStorage()._optionalGroup = newValue}
+  }
+  public var hasOptionalGroup: Bool {
+    return _storage._optionalGroup != nil
+  }
+  public mutating func clearOptionalGroup() {
+    return _storage._optionalGroup = nil
+  }
+
+  var stringStringMap: Dictionary<String,String> {
+    get {return _storage._stringStringMap}
+    set {_uniqueStorage()._stringStringMap = newValue}
+  }
+
+  var oneofUint32: UInt32 {
+    get {
+      if case .oneofUint32(let v) = _storage._oneofField {
+        return v
+      }
+      return 0
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofUint32(newValue)
+    }
+  }
+
+  var oneofTestAllTypes: ProtobufUnittest_TestAllTypesLite {
+    get {
+      if case .oneofTestAllTypes(let v) = _storage._oneofField {
+        return v
+      }
+      return ProtobufUnittest_TestAllTypesLite()
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofTestAllTypes(newValue)
+    }
+  }
+
+  var oneofString: String {
+    get {
+      if case .oneofString(let v) = _storage._oneofField {
+        return v
+      }
+      return ""
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofString(newValue)
+    }
+  }
+
+  var oneofBytes: Data {
+    get {
+      if case .oneofBytes(let v) = _storage._oneofField {
+        return v
+      }
+      return Data()
+    }
+    set {
+      _uniqueStorage()._oneofField = .oneofBytes(newValue)
+    }
+  }
+
+  public var oneofField: OneOf_OneofField {
+    get {return _storage._oneofField}
+    set {
+      _uniqueStorage()._oneofField = newValue
+    }
+  }
+
+  init() {}
+
+  public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws {
+    try _uniqueStorage().decodeField(setter: &setter, protoFieldNumber: protoFieldNumber)
+  }
+
+  public func _protoc_generated_traverse(visitor: inout ProtobufVisitor) throws {
+    try _storage.traverse(visitor: &visitor)
+  }
+
+  public func _protoc_generated_isEqualTo(other: ProtobufUnittest_TestHugeFieldNumbersLite) -> Bool {
+    return _storage === other._storage || _storage.isEqualTo(other: other._storage)
+  }
+
+  private mutating func _uniqueStorage() -> _StorageClass {
+    if !isKnownUniquelyReferenced(&_storage) {
+      _storage = _storage.copy()
+    }
+    return _storage
+  }
+
+  public mutating func setExtensionValue<F: ProtobufExtensionField>(ext: ProtobufGenericMessageExtension<F, ProtobufUnittest_TestHugeFieldNumbersLite>, value: F.ValueType) {
+    return _uniqueStorage().setExtensionValue(ext: ext, value: value)
+  }
+
+  public mutating func clearExtensionValue<F: ProtobufExtensionField>(ext: ProtobufGenericMessageExtension<F, ProtobufUnittest_TestHugeFieldNumbersLite>) {
+    return _storage.clearExtensionValue(ext: ext)
+  }
+
+  public func getExtensionValue<F: ProtobufExtensionField>(ext: ProtobufGenericMessageExtension<F, ProtobufUnittest_TestHugeFieldNumbersLite>) -> F.ValueType {
+    return _storage.getExtensionValue(ext: ext)
+  }
+
+  public func hasExtensionValue<F: ProtobufExtensionField>(ext: ProtobufGenericMessageExtension<F, ProtobufUnittest_TestHugeFieldNumbersLite>) -> Bool {
+    return _storage.hasExtensionValue(ext: ext)
+  }
+  public func _protobuf_fieldNames(for number: Int) -> FieldNameMap.Names? {
+    return ProtobufUnittest_TestHugeFieldNumbersLite._protobuf_fieldNames.fieldNames(for: number) ?? _storage.extensionFieldValues.fieldNames(for: number)
+  }
+}
+
 ///   Singular
 let ProtobufUnittest_Extensions_optionalInt32ExtensionLite = ProtobufGenericMessageExtension<ProtobufOptionalField<ProtobufInt32>, ProtobufUnittest_TestAllExtensionsLite>(protoFieldNumber: 1, fieldNames: .unique(proto: "optional_int32_extension_lite", json: "optionalInt32ExtensionLite", swift: "ProtobufUnittest_optionalInt32ExtensionLite"), defaultValue: 0)
 
@@ -3352,6 +3815,8 @@ let ProtobufUnittest_Extensions_packedBoolExtensionLite = ProtobufGenericMessage
 
 let ProtobufUnittest_Extensions_packedEnumExtensionLite = ProtobufGenericMessageExtension<ProtobufPackedField<ProtobufUnittest_ForeignEnumLite>, ProtobufUnittest_TestPackedExtensionsLite>(protoFieldNumber: 103, fieldNames: .unique(proto: "packed_enum_extension_lite", json: "packedEnumExtensionLite", swift: "ProtobufUnittest_packedEnumExtensionLite"), defaultValue: [])
 
+let ProtobufUnittest_Extensions_testAllTypesLite = ProtobufGenericMessageExtension<ProtobufOptionalMessageField<ProtobufUnittest_TestAllTypesLite>, ProtobufUnittest_TestHugeFieldNumbersLite>(protoFieldNumber: 536860000, fieldNames: .unique(proto: "test_all_types_lite", json: "testAllTypesLite", swift: "ProtobufUnittest_testAllTypesLite"), defaultValue: ProtobufUnittest_TestAllTypesLite())
+
 func ==(lhs: ProtobufUnittest_TestAllTypesLite.OneOf_OneofField, rhs: ProtobufUnittest_TestAllTypesLite.OneOf_OneofField) -> Bool {
   switch (lhs, rhs) {
   case (.oneofUint32(let l), .oneofUint32(let r)): return l == r
@@ -3403,6 +3868,17 @@ extension ProtobufUnittest_TestParsingMergeLite {
   }
 }
 
+func ==(lhs: ProtobufUnittest_TestHugeFieldNumbersLite.OneOf_OneofField, rhs: ProtobufUnittest_TestHugeFieldNumbersLite.OneOf_OneofField) -> Bool {
+  switch (lhs, rhs) {
+  case (.oneofUint32(let l), .oneofUint32(let r)): return l == r
+  case (.oneofTestAllTypes(let l), .oneofTestAllTypes(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 (.None, .None): return true
+  default: return false
+  }
+}
+
 extension ProtobufUnittest_TestAllExtensionsLite {
   ///   Singular
   var ProtobufUnittest_optionalInt32ExtensionLite: Int32 {
@@ -4564,6 +5040,19 @@ extension ProtobufUnittest_TestPackedExtensionsLite {
   }
 }
 
+extension ProtobufUnittest_TestHugeFieldNumbersLite {
+  var ProtobufUnittest_testAllTypesLite: ProtobufUnittest_TestAllTypesLite {
+    get {return getExtensionValue(ext: ProtobufUnittest_Extensions_testAllTypesLite) ?? ProtobufUnittest_TestAllTypesLite()}
+    set {setExtensionValue(ext: ProtobufUnittest_Extensions_testAllTypesLite, value: newValue)}
+  }
+  var hasProtobufUnittest_testAllTypesLite: Bool {
+    return hasExtensionValue(ext: ProtobufUnittest_Extensions_testAllTypesLite)
+  }
+  mutating func clearProtobufUnittest_testAllTypesLite() {
+    clearExtensionValue(ext: ProtobufUnittest_Extensions_testAllTypesLite)
+  }
+}
+
 let ProtobufUnittest_UnittestLite_Extensions: ProtobufExtensionSet = [
   ProtobufUnittest_Extensions_optionalInt32ExtensionLite,
   ProtobufUnittest_Extensions_optionalInt64ExtensionLite,
@@ -4654,6 +5143,7 @@ let ProtobufUnittest_UnittestLite_Extensions: ProtobufExtensionSet = [
   ProtobufUnittest_Extensions_packedDoubleExtensionLite,
   ProtobufUnittest_Extensions_packedBoolExtensionLite,
   ProtobufUnittest_Extensions_packedEnumExtensionLite,
+  ProtobufUnittest_Extensions_testAllTypesLite,
   ProtobufUnittest_TestNestedExtensionLite.Extensions.nestedExtension,
   ProtobufUnittest_TestParsingMergeLite.Extensions.optionalExt,
   ProtobufUnittest_TestParsingMergeLite.Extensions.repeatedExt