Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't compile with Xcode10, Swift 4.2 #57

Open
arekt opened this issue Sep 29, 2018 · 2 comments
Open

Doesn't compile with Xcode10, Swift 4.2 #57

arekt opened this issue Sep 29, 2018 · 2 comments

Comments

@arekt
Copy link

arekt commented Sep 29, 2018

Did try to use s3 and aws-sdk-swift-core.git and everything worked yesterday. Today did upgrade to XCode 10 and I my example program don't work anymore. Did pull latest Prorsum and the same issue. Google point me to https://bugs.swift.org/browse/SR-7940 but I don't have enough knowledge so it might take me some time to solve the problem.

I do have error like below:

 $ swift build                                                       [18:23:40]
warning: PackageDescription API v3 is deprecated and will be removed in the future; used by package(s): CHTTPParser, HypertextApplicationLanguage
Compile Swift Module 'Prorsum' (36 sources)
/Users/arekt/workspace/xcode-projects/cmdLine/.build/checkouts/Prorsum.git--2603624182250228903/Sources/Prorsum/WebSocket/Data+WebsocketCompute.swift:63:25: error: ambiguous use of 'subscript'
        let slice = self[offset..<offset+size]
                        ^
Foundation.Data:61:12: note: found this candidate
    public subscript(bounds: Range<Data.Index>) -> Data { get set }
           ^
ProrsumNet.Data:4:12: note: found this candidate
    public subscript(bounds: Range<Int>) -> Data { get }
           ^
/Users/arekt/workspace/xcode-projects/cmdLine/.build/checkouts/Prorsum.git--2603624182250228903/Sources/Prorsum/WebSocket/Data+WebsocketCompute.swift:48:26: warning: 'deinitialize()' is deprecated: the default argument to deinitialize(count:) has been removed, please specify the count explicitly
            valuePointer.deinitialize()
                         ^
/Users/arekt/workspace/xcode-projects/cmdLine/.build/checkouts/Prorsum.git--2603624182250228903/Sources/Prorsum/WebSocket/Data+WebsocketCompute.swift:49:26: warning: 'deallocate(capacity:)' is deprecated: Swift currently only supports freeing entire heap blocks, use deallocate() instead
            valuePointer.deallocate(capacity: 1)
                         ^
/Users/arekt/workspace/xcode-projects/cmdLine/.build/checkouts/Prorsum.git--2603624182250228903/Sources/Prorsum/WebSocket/Frame.swift:127:20: error: ambiguous use of 'subscript'
        return data[offset..<data.count]
                   ^
Foundation.Data:61:12: note: found this candidate
    public subscript(bounds: Range<Data.Index>) -> Data { get set }
           ^
ProrsumNet.Data:4:12: note: found this candidate
    public subscript(bounds: Range<Int>) -> Data { get }
           ^
/Users/arekt/workspace/xcode-projects/cmdLine/.build/checkouts/Prorsum.git--2603624182250228903/Sources/Prorsum/WebSocket/Frame.swift:152:24: error: ambiguous use of 'subscript'
            return data[2..<6]
                       ^
Foundation.Data:61:12: note: found this candidate
    public subscript(bounds: Range<Data.Index>) -> Data { get set }
           ^
ProrsumNet.Data:4:12: note: found this candidate
    public subscript(bounds: Range<Int>) -> Data { get }
           ^
/Users/arekt/workspace/xcode-projects/cmdLine/.build/checkouts/Prorsum.git--2603624182250228903/Sources/Prorsum/WebSocket/Frame.swift:154:24: error: ambiguous use of 'subscript'
            return data[4..<8]
                       ^
Foundation.Data:61:12: note: found this candidate
    public subscript(bounds: Range<Data.Index>) -> Data { get set }
           ^
ProrsumNet.Data:4:12: note: found this candidate
    public subscript(bounds: Range<Int>) -> Data { get }
           ^
/Users/arekt/workspace/xcode-projects/cmdLine/.build/checkouts/Prorsum.git--2603624182250228903/Sources/Prorsum/WebSocket/Frame.swift:156:20: error: ambiguous use of 'subscript'
        return data[10..<14]
                   ^
Foundation.Data:61:12: note: found this candidate
    public subscript(bounds: Range<Data.Index>) -> Data { get set }
           ^
ProrsumNet.Data:4:12: note: found this candidate
    public subscript(bounds: Range<Int>) -> Data { get }
           ^
/Users/arekt/workspace/xcode-projects/cmdLine/.build/checkouts/Prorsum.git--2603624182250228903/Sources/Prorsum/WebSocket/Frame.swift:212:42: error: ambiguous use of 'subscript'
            let remainingData = self.data[Int(totalFrameSize)..<self.data.count]
                                         ^
Foundation.Data:61:12: note: found this candidate
    public subscript(bounds: Range<Data.Index>) -> Data { get set }
           ^
ProrsumNet.Data:4:12: note: found this candidate
    public subscript(bounds: Range<Int>) -> Data { get }
           ^
/Users/arekt/workspace/xcode-projects/cmdLine/.build/checkouts/Prorsum.git--2603624182250228903/Sources/Prorsum/WebSocket/Frame.swift:213:34: error: ambiguous use of 'subscript'
            self.data = self.data[0..<Int(totalFrameSize)]
                                 ^
Foundation.Data:61:12: note: found this candidate
    public subscript(bounds: Range<Data.Index>) -> Data { get set }
           ^
ProrsumNet.Data:4:12: note: found this candidate
    public subscript(bounds: Range<Int>) -> Data { get }
           ^
/Users/arekt/workspace/xcode-projects/cmdLine/.build/checkouts/Prorsum.git--2603624182250228903/Sources/Prorsum/WebSocket/WebSocket.swift:189:47: error: ambiguous use of 'subscript'
            let bytesRead = try readBytes(data[totalBytesRead..<data.count])
                                              ^
Foundation.Data:61:12: note: found this candidate
    public subscript(bounds: Range<Data.Index>) -> Data { get set }
           ^
ProrsumNet.Data:4:12: note: found this candidate
    public subscript(bounds: Range<Int>) -> Data { get }
           ^
/Users/arekt/workspace/xcode-projects/cmdLine/.build/checkouts/Prorsum.git--2603624182250228903/Sources/Prorsum/WebSocket/WebSocket.swift:312:47: error: ambiguous use of 'subscript'
                    rawCloseCode = UInt16(data[0..<2].data.toInt(2))
                                              ^
Foundation.Data:61:12: note: found this candidate
    public subscript(bounds: Range<Data.Index>) -> Data { get set }
           ^
ProrsumNet.Data:4:12: note: found this candidate
    public subscript(bounds: Range<Int>) -> Data { get }
           ^
/Users/arekt/workspace/xcode-projects/cmdLine/.build/checkouts/Prorsum.git--2603624182250228903/Sources/Prorsum/WebSocket/WebSocket.swift:313:32: error: ambiguous use of 'subscript'
                    data = data[2..<data.count].data // TODO: is this efficient?
                               ^
Foundation.Data:61:12: note: found this candidate
    public subscript(bounds: Range<Data.Index>) -> Data { get set }
           ^
ProrsumNet.Data:4:12: note: found this candidate
    public subscript(bounds: Range<Int>) -> Data { get }
           ^
error: terminated(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/arekt/workspace/xcode-projects/cmdLine/.build/debug.yaml main output:


FAIL

cheers,
Arek Turlewicz

@foulkesjohn
Copy link

I've created a fix for this in ProrsumNet: noppoMan/ProrsumNet#5

@arekt
Copy link
Author

arekt commented Oct 20, 2018

Thanks a lot @foulkesjohn !!!
Just learned about editable package function of SPM so will try it out :)

swift package edit ProrsumNet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants