You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jano Svitok (Jira)" <ji...@apache.org> on 2020/03/25 21:03:00 UTC
[jira] [Commented] (THRIFT-5150) TSet does not compile with Swift
5.2
[ https://issues.apache.org/jira/browse/THRIFT-5150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17067088#comment-17067088 ]
Jano Svitok commented on THRIFT-5150:
-------------------------------------
PR: https://github.com/apache/thrift/pull/2069
Also, on Linux it seems that kCFSocketCloseOnInvalidate has Int type. I can't find out why. Nevertheless, typecast fixes it.
> TSet does not compile with Swift 5.2
> ------------------------------------
>
> Key: THRIFT-5150
> URL: https://issues.apache.org/jira/browse/THRIFT-5150
> Project: Thrift
> Issue Type: Bug
> Components: Swift - Library
> Affects Versions: 0.14.0
> Reporter: Jano Svitok
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Output from compilation:
> {noformat}
> /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>
> ^
> {noformat}
>
> Reproduction:
> Change https://github.com/apache/thrift/blob/master/build/docker/ubuntu-bionic/Dockerfile#L254 to:
> {noformat}
> 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
> {noformat}
> I will provide fix.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)