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

Can't build with Xcode 8 Beta 6 #41

Closed
randyhill opened this issue Aug 31, 2016 · 4 comments
Closed

Can't build with Xcode 8 Beta 6 #41

randyhill opened this issue Aug 31, 2016 · 4 comments

Comments

@randyhill
Copy link

I'm trying to use Just in an iOS 10 message extension. Due to various issues, Cocoapods isn't working for me, so I've tried dropping in Just.swift, but I get a whole mess of compile errors, some I don't feel confident about fixing.

Has Swift 3 syntax changed since your last build?

@randyhill
Copy link
Author

One example

public lazy var headers:CaseInsensitiveDictionary<String,String> = {
    return CaseInsensitiveDictionary<String,String>(dictionary: (self.response as? HTTPURLResponse)?.allHeaderFields as? [String:String] ?? [:])
}()

produces the error Expression type '[String : String]? is ambiguous without more context, on the return line.

@randyhill
Copy link
Author

This works...
public lazy var headers:CaseInsensitiveDictionary<String,String> = {
if let httpResponse = self.response as? HTTPURLResponse {
let headerFieldsDict = httpResponse.allHeaderFields as NSDictionary? as? [String:String]
return CaseInsensitiveDictionary<String,String>(dictionary: headerFieldsDict ?? [:])
}
return [:]
}()

https://forums.developer.apple.com/message/169819#169819

@randyhill
Copy link
Author

I have fixed all the other compile errors, will try to check in my version to you after I see if it works.

@dduan
Copy link
Owner

dduan commented Sep 11, 2016

Thank you. Master should work with Xcode 8 GM now.

@dduan dduan closed this as completed Sep 11, 2016
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