alexeyxo/protobuf-swift

XCode 9 beta3 breaks Google.Protobuf.`Type` and Google.Protobuf.FieldDescriptorProto.`Type`

marner2 opened this issue · 1 comments

Version of XCode

XCode 9.0 beta 3 (9M174d)

Version of Swift

Swift 3.2

Version of ProtocolBuffers-Swift pod

pod 'ProtocolBuffers-Swift', :git => 'https://github.com/alexeyxo/protobuf-swift.git', :tag => '3.0.21'

Description

When compiling this project, the most recent version of XCode 9.0 will throw 23 errors related to this issue. They are as follows:

  • Google.Protobuf.Descriptor.proto.swift
Showing Recent Messages
/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Descriptor.proto.swift:2878:88: Type 'Google.Protobuf.FieldDescriptorProto.Type' has no member 'typeDouble'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Descriptor.proto.swift:3554:44: Non-nominal type 'Google.Protobuf.FieldDescriptorProto.Type' does not support explicit initialization

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Descriptor.proto.swift:3602:53: Type 'Google.Protobuf.FieldDescriptorProto.Type' has no member 'fromString'
  • Google.Protobuf.Type.proto.swift
Showing Recent Messages
/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:244:68: Non-nominal type 'Google.Protobuf.Type' does not support explicit initialization

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:113:20: Type 'Google.Protobuf.Type' has no member 'classBuilder'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:119:20: Type 'Google.Protobuf.Type' has no member 'Builder'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:122:20: Type 'Google.Protobuf.Type' has no member 'Builder'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:125:24: Type 'Google.Protobuf.Type' has no member 'builderWithPrototype'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:128:24: Type 'Google.Protobuf.Type' has no member 'Builder'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:168:24: Type 'Google.Protobuf.Type' has no member 'Builder'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:171:24: Type 'Google.Protobuf.Type' has no member 'Builder'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:398:33: Non-nominal type 'Google.Protobuf.Type' does not support explicit initialization

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:402:28: Type 'Google.Protobuf.Type' has no member 'builderWithPrototype'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:414:29: Non-nominal type 'Google.Protobuf.Type' does not support explicit initialization

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:482:44: Type 'Google.Protobuf.Type' has no member 'Builder'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:522:28: Type 'Google.Protobuf.Type' has no member 'Builder'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:2446:20: Type 'Google.Protobuf.Type' has no member 'Builder'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:2449:20: Type 'Google.Protobuf.Type' has no member 'Builder'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:2452:20: Type 'Google.Protobuf.Type' has no member 'Builder'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:2455:20: Type 'Google.Protobuf.Type' has no member 'Builder'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:2458:20: Type 'Google.Protobuf.Type' has no member 'Builder'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:2461:20: Type 'Google.Protobuf.Type' has no member 'Builder'

/Code/Pods/ProtocolBuffers-Swift/Source/Google.Protobuf.Type.proto.swift:2464:20: Type 'Google.Protobuf.Type' has no member 'Builder'

Notes

This does not happen on XCode 9 beta 2. Both are supposedly compiled with the Swift 3.2 compiler. We should probably check with Apple to see if this is intentional or if it was an error with their compiler.

Potential Workarounds

Rename `Type` to ProtobufType for disambiguation.

Same issue with Xcode 9 beta 4 / Swift 3.2.