-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Foundation overlay] Enable custom AnyHashable representation for NSMeasurement #4793
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
[Foundation overlay] Enable custom AnyHashable representation for NSMeasurement #4793
Conversation
@swift-ci please smoke test and merge |
@gribozavr , do you mind taking a look? |
unit: UnitLength.kilometers) | ||
let ah = AnyHashable(measurement) | ||
expectTrue(type(of: ah.base) is Measurement.Type) | ||
} |
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.
Please move the tests to test/stdlib/TestMeasurement.swift
instead. Please follow the pattern in test_AnyHashableCreatedFromNSCalendar
from test/stdlib/TestCalendar.swift
.
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.
Okay, thanks!
7aa3a7e
to
87ab304
Compare
…easurement Enables the overlay behavior blocked by rdar://problem/27539951.
87ab304
to
fa4331b
Compare
@swift-ci please smoke test and merge |
@gribozavr updated, thank you! |
NSMeasurement(doubleValue: 100, unit: UnitLength.kilometers), | ||
] | ||
let anyHashables = values.map(AnyHashable.init) | ||
expectEqual(Measurement.self, type(of: anyHashables[0].base)) |
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 with an explicit generic type parameter on Measurement
in the assertion.
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.
Will do, thanks!
} | ||
|
||
func test_AnyHashableCreatedFromNSMeasurement() { | ||
if #available(iOS 8.0, *) { |
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 availability check doesn't make sense to me - NSMeasurement is new in iOS 10 and OS X 10.12.
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.
Good catch; this whole test is already iOS 10/macOS 10.12. Fixed in a subsequent commit.
@swift-ci please smoke test and merge |
[pull] swiftwasm-release/5.7 from release/5.7
Enable custom AnyHashable representation for NSMeasurement
Resolves rdar://problem/27539951.