-
Notifications
You must be signed in to change notification settings - Fork 23
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
Update to Swift 4.2, use Hasher, fix Xcode 10.2 compilation complaints. #157
Update to Swift 4.2, use Hasher, fix Xcode 10.2 compilation complaints. #157
Conversation
// On 32bit CPUs, this will *potentially, rarely, in the case of generating tons of tokens* be problematic. | ||
// Token gives back an Int64 which on 32bit platforms when cast to Int could overflow. This is not a factor | ||
// on iOS 11+ as that OS supports 64bit CPUs only and isn't a factor on macOS 10.7+. | ||
return ModelVersion(hash: Int(Token.makeUnique().rawValue)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth calling out this issue with a comment.
|
||
public var hashValue: Int { | ||
return sectionIndex.hashValue ^ itemIndex.hashValue | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatic hashable conformance.
case .doubleClick: | ||
return 1<<6 | ||
hasher.combine(1<<6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced this is the best we can do here, but it's what we had.
public var hashValue: Int { | ||
return value.hashValue | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatic conformance to hashable
@@ -1422,6 +1401,7 @@ | |||
PRODUCT_BUNDLE_IDENTIFIER = com.Dropbox.Pilot; | |||
PRODUCT_NAME = Pilot; | |||
SKIP_INSTALL = YES; | |||
SWIFT_VERSION = 4.2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need Swift 4.2 for Hasher
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We try to put these in .xccodeconfig files when possible
…enuItemValidation is now a formal protocol. Also more redundant access specifiers.
Heya @danielrhammond — @laposheureux and I chatted briefly offline. Two quick recommendations:
thanks! |
This looks good to me, and checks out on 10.1, @wkiefer mind taking a look with the model version compat stuff + I think your previous comments now addressed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thx!
@@ -1422,6 +1401,7 @@ | |||
PRODUCT_BUNDLE_IDENTIFIER = com.Dropbox.Pilot; | |||
PRODUCT_NAME = Pilot; | |||
SKIP_INSTALL = YES; | |||
SWIFT_VERSION = 4.2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We try to put these in .xccodeconfig files when possible
|
||
open override func validateMenuItem(_ menuItem: NSMenuItem) -> Bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an odd change — might want to sanity check it's still getting called
The menuitem change was an api change accompanying swift 4.2 - more info here: https://forums.developer.apple.com/thread/107328
Aaron
… On Feb 12, 2019, at 11:31 AM, Will Kiefer ***@***.***> wrote:
@wkiefer approved this pull request.
LGTM - thx!
In Pilot.xcodeproj/project.pbxproj:
> @@ -1422,6 +1401,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.Dropbox.Pilot;
PRODUCT_NAME = Pilot;
SKIP_INSTALL = YES;
+ SWIFT_VERSION = 4.2;
We try to put these in .xccodeconfig files when possible
In UI/Source/CollectionViews/mac/CollectionViewController.swift:
>
- open override func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
this is an odd change — might want to sanity check it's still getting called
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I think I've massaged away the Travis issues and fixed the obvious compilation problems across platforms...pending Travis giving me a green light finally.
Info about
Hasher
here: https://github.com/apple/swift-evolution/blob/master/proposals/0206-hashable-enhancements.md