File tree Expand file tree Collapse file tree 1 file changed +0
-24
lines changed
wire-swift-generator/src/main/java/com/squareup/wire/swift Expand file tree Collapse file tree 1 file changed +0
-24
lines changed Original file line number Diff line number Diff line change @@ -292,28 +292,6 @@ class SwiftGenerator private constructor(
292292 return field.type in referenceCycleIndirections.getOrDefault(type.type, emptySet())
293293 }
294294
295- /* *
296- * Checks that every enum in a proto3 message contains a value with tag 0.
297- *
298- * @throws NoSuchElementException if the case doesn't exist
299- */
300- @Throws(NoSuchElementException ::class )
301- private fun validateProto3DefaultsExist (type : MessageType ) {
302- // TODO: Remove when we support unknown cases
303- if (type.syntax == PROTO_2 ) { return }
304-
305- // validate each enum field
306- type
307- .fields
308- .mapNotNull { schema.getType(it.type!! ) as ? EnumType }
309- .forEach { enum ->
310- // ensure that a protoDefaultedName case exists
311- if (enum.protoDefaultedName == null ) {
312- throw NoSuchElementException (" Missing a zero value for ${enum.name} " )
313- }
314- }
315- }
316-
317295 @OptIn(ExperimentalStdlibApi ::class ) // TODO move to build flag
318296 private fun generateMessage (
319297 type : MessageType ,
@@ -332,8 +310,6 @@ class SwiftGenerator private constructor(
332310
333311 val typeSpecs = mutableListOf<TypeSpec >()
334312
335- validateProto3DefaultsExist(type)
336-
337313 typeSpecs + = TypeSpec .structBuilder(structType)
338314 .addModifiers(PUBLIC )
339315 .apply {
You can’t perform that action at this time.
0 commit comments