@@ -103,17 +103,15 @@ enum Proto3TestEnumWithDupValue: SwiftProtobuf.Enum, SwiftProtobuf._ProtoNamePro
103103 case foo1 // = 1
104104 case bar1 // = 2
105105 case baz // = 3
106- case foo2 // = 1
107- case bar2 // = 2
106+ static let foo2 = foo1
107+ static let bar2 = bar1
108108 case UNRECOGNIZED( Int )
109109
110110 static let _protobuf_nameMap : SwiftProtobuf . _NameMap = [
111111 0 : . same( proto: " TEST_ENUM_WITH_DUP_VALUE_UNSPECIFIED " ) ,
112- 1 : . same ( proto: " FOO1 " ) ,
113- 2 : . same ( proto: " BAR1 " ) ,
112+ 1 : . aliased ( proto: " FOO1 " , aliases : [ " FOO2 " ] ) ,
113+ 2 : . aliased ( proto: " BAR1 " , aliases : [ " BAR2 " ] ) ,
114114 3 : . same( proto: " BAZ " ) ,
115- 1 : . same( proto: " FOO2 " ) ,
116- 2 : . same( proto: " BAR2 " ) ,
117115 ]
118116
119117 init ( ) {
@@ -136,8 +134,6 @@ enum Proto3TestEnumWithDupValue: SwiftProtobuf.Enum, SwiftProtobuf._ProtoNamePro
136134 case . foo1: return 1
137135 case . bar1: return 2
138136 case . baz: return 3
139- case . foo2: return 1
140- case . bar2: return 2
141137 case . UNRECOGNIZED( let i) : return i
142138 }
143139 }
@@ -160,13 +156,13 @@ enum Proto3TestSparseEnum: SwiftProtobuf.Enum, SwiftProtobuf._ProtoNameProviding
160156 case UNRECOGNIZED( Int )
161157
162158 static let _protobuf_nameMap : SwiftProtobuf . _NameMap = [
159+ - 53452 : . same( proto: " SPARSE_E " ) ,
160+ - 15 : . same( proto: " SPARSE_D " ) ,
163161 0 : . same( proto: " TEST_SPARSE_ENUM_UNSPECIFIED " ) ,
162+ 2 : . same( proto: " SPARSE_G " ) ,
164163 123 : . same( proto: " SPARSE_A " ) ,
165164 62374 : . same( proto: " SPARSE_B " ) ,
166165 12589234 : . same( proto: " SPARSE_C " ) ,
167- - 15 : . same( proto: " SPARSE_D " ) ,
168- - 53452 : . same( proto: " SPARSE_E " ) ,
169- 2 : . same( proto: " SPARSE_G " ) ,
170166 ]
171167
172168 init ( ) {
@@ -175,26 +171,26 @@ enum Proto3TestSparseEnum: SwiftProtobuf.Enum, SwiftProtobuf._ProtoNameProviding
175171
176172 init ? ( rawValue: Int ) {
177173 switch rawValue {
174+ case - 53452 : self = . sparseE
175+ case - 15 : self = . sparseD
178176 case 0 : self = . testSparseEnumUnspecified
177+ case 2 : self = . sparseG
179178 case 123 : self = . sparseA
180179 case 62374 : self = . sparseB
181180 case 12589234 : self = . sparseC
182- case - 15 : self = . sparseD
183- case - 53452 : self = . sparseE
184- case 2 : self = . sparseG
185181 default : self = . UNRECOGNIZED( rawValue)
186182 }
187183 }
188184
189185 var rawValue : Int {
190186 switch self {
187+ case . sparseE: return - 53452
188+ case . sparseD: return - 15
191189 case . testSparseEnumUnspecified: return 0
190+ case . sparseG: return 2
192191 case . sparseA: return 123
193192 case . sparseB: return 62374
194193 case . sparseC: return 12589234
195- case . sparseD: return - 15
196- case . sparseE: return - 53452
197- case . sparseG: return 2
198194 case . UNRECOGNIZED( let i) : return i
199195 }
200196 }
@@ -751,11 +747,11 @@ struct Proto3TestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen
751747 case UNRECOGNIZED( Int )
752748
753749 static let _protobuf_nameMap : SwiftProtobuf . _NameMap = [
750+ - 1 : . same( proto: " NEG " ) ,
754751 0 : . same( proto: " NESTED_ENUM_UNSPECIFIED " ) ,
755752 1 : . same( proto: " FOO " ) ,
756753 2 : . same( proto: " BAR " ) ,
757754 3 : . same( proto: " BAZ " ) ,
758- - 1 : . same( proto: " NEG " ) ,
759755 ]
760756
761757 init ( ) {
@@ -764,22 +760,22 @@ struct Proto3TestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplemen
764760
765761 init ? ( rawValue: Int ) {
766762 switch rawValue {
763+ case - 1 : self = . neg
767764 case 0 : self = . nestedEnumUnspecified
768765 case 1 : self = . foo
769766 case 2 : self = . bar
770767 case 3 : self = . baz
771- case - 1 : self = . neg
772768 default : self = . UNRECOGNIZED( rawValue)
773769 }
774770 }
775771
776772 var rawValue : Int {
777773 switch self {
774+ case . neg: return - 1
778775 case . nestedEnumUnspecified: return 0
779776 case . foo: return 1
780777 case . bar: return 2
781778 case . baz: return 3
782- case . neg: return - 1
783779 case . UNRECOGNIZED( let i) : return i
784780 }
785781 }
0 commit comments