swift-protobuf: Problems with generated sources in multiple modules with Swift 3.1

I upgraded to Swift 3.1 Then I updated to swift-protobuf 0.9.29 Compiled proto-gen-swift from the 0.9.29 sources and use the 0.9.29 version as a dependency.

Some protobuf files that were previously working correctly now generate hundreds of errors like:

/.../Work/Swift/Systems/****/.build/checkouts/***Protobuf-5523697989699535816/Sources/***Messages.pb.swift:1292:22: note: overloads for '!=' exist with these partially matching parameter lists: (Any.Type?, Any.Type?), (UInt8, UInt8), (Int8, Int8), (UInt16, UInt16), (Int16, Int16), (UInt32, UInt32), (Int32, Int32), (UInt64, UInt64), (Int64, Int64), (UInt, UInt), (Int, Int), (ContiguousArray<Element>, ContiguousArray<Element>), (ArraySlice<Element>, ArraySlice<Element>), (T?, T?), (T?, _OptionalNilComparisonType), (_OptionalNilComparisonType, T?), ((A, B), (A, B)), ((A, B, C), (A, B, C)), ((A, B, C, D), (A, B, C, D)), ((A, B, C, D, E), (A, B, C, D, E)), ((A, B, C, D, E, F), (A, B, C, D, E, F)), (LazyFilterIndex<Base>, LazyFilterIndex<Base>), ([Key : Value], [Key : Value])
    if snapshotEntry != other.snapshotEntry {return false}
                     ^
/.../Work/Swift/Systems/****/.build/checkouts/***-5523697989699535816/Sources/***Messages.pb.swift:1476:17: error: binary operator '!=' cannot be applied to two '[Proto****]' operands
    if trendbar != other.trendbar {return false}
       ~~~~~~~~ ^  ~~~~~~~~~~~~~~

Any help appreciated!

swift version: 3.1 protoc version: 3.2.0 protoc-gen-swift version: 0.9.29 MacOS: 10.12.4

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 31 (4 by maintainers)

Most upvoted comments

For future self (or anyone else that looks at this) – Reading the SwiftPM sources, they do a bunch of tests by using “Fixtures” that clone a directory, turn it into a git repo, and then run SwiftPM on it so they can unittest the behaviors/operations. That’s about the only way I can see to do tests for this as I realized even when we get branch support in Packages, it would be pinned, so while someone works on a a CL, the tests wouldn’t be using the code the developer has locally (let alone locally committed to their branch).