Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-5150

TSet does not compile with Swift 5.2

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.14.0
    • 0.14.0
    • Swift - Library
    • None

    Description

      Output from compilation:

      /thrift/src/lib/swift/Sources/TSet.swift:22:15: error: type 'TSet<Element>' does not conform to protocol 'SetAlgebra'
      public struct TSet<Element : TSerializable & Hashable> : SetAlgebra, Hashable, Collection, ExpressibleByArrayLiteral, TSerializable {
                    ^
      /thrift/src/lib/swift/Sources/TSet.swift:129:14: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'TSet' to 'Hashable' by implementing 'hash(into:)' instead
        public var hashValue : Int {
                   ^
      /thrift/src/lib/swift/Sources/TSet.swift:22:15: error: type 'TSet<Element>' does not conform to protocol 'Collection'
      public struct TSet<Element : TSerializable & Hashable> : SetAlgebra, Hashable, Collection, ExpressibleByArrayLiteral, TSerializable {
                    ^
      /thrift/src/lib/swift/Sources/TSet.swift:22:15: error: type 'TSet<Element>' does not conform to protocol 'Sequence'
      public struct TSet<Element : TSerializable & Hashable> : SetAlgebra, Hashable, Collection, ExpressibleByArrayLiteral, TSerializable {
                    ^
      Swift.Sequence:3:20: note: unable to infer associated type 'Iterator' for protocol 'Sequence'
          associatedtype Iterator : IteratorProtocol
                         ^
      Swift.Sequence:2:40: note: candidate would match and infer 'Iterator' = 'TSet<Element>' if 'TSet<Element>' conformed to 'IteratorProtocol'
          @inlinable public __consuming func makeIterator() -> Self
                                             ^
      Swift.SetAlgebra:2:20: note: protocol requires nested type 'Element'; do you want to add it?
          associatedtype Element
                         ^
      Swift.Collection:4:20: note: protocol requires nested type 'Element'; do you want to add it?
          associatedtype Element
                         ^
      Swift.Collection:8:20: note: protocol requires nested type 'Iterator'; do you want to add it?
          associatedtype Iterator = IndexingIterator<Self>
                         ^
      

       
      Reproduction:

      Change https://github.com/apache/thrift/blob/master/build/docker/ubuntu-bionic/Dockerfile#L254 to:

      RUN cd / && \
          wget --quiet https://swift.org/builds/swift-5.2-release/ubuntu1804/swift-5.2-RELEASE/swift-5.2-RELEASE-ubuntu18.04.tar.gz && \
          tar xf swift-5.2-RELEASE-ubuntu18.04.tar.gz --strip-components=1 && \
          rm swift-5.2-RELEASE-ubuntu18.04.tar.gz && \
          swift --version
      
      

      I will provide fix.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            janosvitok Jano Svitok
            janosvitok Jano Svitok
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 10m
                10m

                Slack

                  Issue deployment