Commit Graph

8 Commits

Author SHA1 Message Date
Nate Cook
956e793ef0 Improve consistency in NSNumber bridging
This makes sure casts of NaN succeed, and init(exactly: NaN) fails.
2017-12-01 13:44:33 -06:00
Jordan Rose
1598a21e43 DI: Warn on non-delegating cross-module struct initializers
...as detected by initializing an individual field without having
initialized the whole object (via `self = value`).

This only applies in pre-Swift-5 mode because the next commit will
treat all cross-module struct initializers as delegating in Swift 5.
2017-11-09 11:24:28 -08:00
Itai Ferber
5252f3b2f8 Fix NSNumber's custom AnyHashable representation
When we give NSNumber a custom AnyHashable representation, we want to
give it as large a box as possible. When we want to compare it against
other AnyHashable boxes such as Int or UInt, it's always possible to
upcast the Int/UInt to a larger integer size like Int64 or UInt64 for
the comparison. By eliminating the smaller boxes we create, we can
maintain the existing behavior that _SwiftTypePreservingNSNumber gave
us.
2017-07-24 12:22:45 -07:00
Philippe Hausler
c358afe655 [Foundation] Adjust Double and Float bridges to be more lenient 2017-06-16 15:18:27 -07:00
Philippe Hausler
689fc28edc [Foundation] Add migration hints for deprecated NSNumber based initializers 2017-06-16 15:18:27 -07:00
Philippe Hausler
fa39edf6a0 Account for floating point exactly conversions and disable some tests that are caused by SR-4634 2017-04-20 13:34:04 -07:00
Philippe Hausler
d26970e77a Validate the exactly pattern of Double from NSNumber to ensure proper IEEE 754 non lossy conversions 2017-04-17 17:19:20 -07:00
Philippe Hausler
24469a9512 [Foundation] NSNumber bridging and Numeric types (SE-0170) 2017-04-17 15:01:02 -07:00