Commit Graph

14 Commits

Author SHA1 Message Date
Doug Gregor
fa4331b729 [Foundation overlay] Enable custom AnyHashable representation for NSMeasurement
Enables the overlay behavior blocked by rdar://problem/27539951.
2016-09-14 22:22:36 -07:00
Philippe Hausler
25e93ad51d Additional conformance changes for Measurement and unit tests to verify comparison and equality
After speaking with the current owner of Measurement, the most sensible path is to at runtime verifty the conformance of Units to a specific dimension since we cannot directly check at compile time. If at a future point in time a more specific comparitor can be added that can restrict the comparison to measurements in a specific dimension without causing equatable failures we may want to revisit this. However as it stands this preserves the most reasonable implementation of comparison of disperate measurement unit types while preserving the expected logic of conversions within that dimension.
2016-08-09 14:04:24 -07:00
Philippe Hausler
2a9c11c564 [Foundation] Simplify the comparison routines for Measurement
The default implementation for comparable automatically adds >, >= etc by having == and < defined. Also the dynamic check for comparison of measurements that are convertible should traverse through the same runtime equality check instead of a static dispatch call out.

This resolves:
<rdar://problem/27556581> Measurement type defines two '==' functions
2016-08-09 14:04:24 -07:00
Robert Widmann
4f465224ea Polish off uses of dynamicType in tests 2016-07-29 16:59:14 -07:00
Robert Widmann
14dc86cf15 Polish off uses of dynamicType in codebase 2016-07-29 16:58:40 -07:00
Joe Groff
4b9e49827d Make all _toAnyHashable() implements @nonobjc. 2016-07-27 09:25:30 -07:00
Dmitri Gribenko
e9f1bccd37 Foundation: add commented out custom AnyHashable representation to Measurement
It is disabled because bridging of Measurement instances does not actually work now.
2016-07-26 03:10:52 -07:00
swift-ci
3cfcb55bfc Merge pull request #3752 from parkera/foundation_reflection 2016-07-25 22:29:48 -07:00
Tony Parker
dab81e8674 Add CustomReflectable implementation to most Foundation value types.
Also improves the basic debugDescription and description methods.

rdar://26580762
2016-07-25 17:05:51 -07:00
Joe Groff
32b50c624d stdlib: Remove _isBridgedToObjectiveC from _ObjectiveCBridgeable.
All generic bridgeable types can bridge for all their instantiations now. Removing this ferrets out some now-unnecessary traps that check for unbridgeable parameter types.
2016-07-25 06:01:21 -07:00
Doug Gregor
ab3a15c87a [SE-0091 / Foundation overlay] Move operators into types.
Foundation provides a number of specific operators defined in the
global scope. Push all of these into their corresponding types. This
cleanup helps verify that the SE-0091 implementation is generally
functional.
2016-07-18 23:18:57 -07:00
Tony Parker
443bb590f5 Add a workaround for MeasurementFormatter so it can use Measurement
Due to current language limitations (26607639), MeasurementFormatter's
stringFromMeasurement: is esentially useless when imported into Swift.
This workaround allows it to work as expected.

<rdar://problem/27173952> Workaround: MeasurementFormatter.string(from:
Measurement<Unit>) doesn't recognize subclasses of Unit
2016-07-07 09:57:54 -07:00
practicalswift
8d03ea1347 [gardening] Fix some recently introduced typos. 2016-06-19 21:28:36 +02:00
Mishal Shah
87b7bcfd3e Update master to build with Xcode 8 beta 1, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-06-14 14:53:55 -07:00