Commit Graph

1285 Commits

Author SHA1 Message Date
Max Moiseev
7569dc9585 "[overlay] Add back INSetProfileInCarIntent.defaultProfile for compatibliity
<rdar://problem/33457609>
2017-07-25 15:19:43 -07:00
swift-ci
5684766a83 Merge pull request #11167 from DougGregor/nscolor-literal-extended-srgb 2017-07-25 09:19:32 -07:00
Doug Gregor
8b3889a0a3 [AppKit overlay] Use NSColor(red:green:blue:alpha:) for color literals.
This initializer, which is the same on iOS, allows negative values and
values > 1.0 to support the extended sRGB color space.

Fixes rdar://problem/33500905.
2017-07-25 07:58:20 -07:00
Itai Ferber
c962bdb56c Merge pull request #11148 from itaiferber/indexset-rangeview-fixes
Fix IndexSet.RangeView indexing with subranges
2017-07-24 19:32:50 -07:00
Itai Ferber
b05866a92f Fix IndexSet.RangeView indexing with subranges
On initialization, IndexSet.RangeView made the erroneous assumption that given an intersection range, a nil _indexOfRange(containing: bound) indicated that the bound was beyond the beginning or end of the index set. Instead, the index could simply not exist.

We now calculate the actual intersection of the parent index set with the given intersection range and use that as the index set to view.

This also makes the unit tests for testing range views more comprehensive.
2017-07-24 15:32:03 -07: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
Itai Ferber
f6e48dceb6 Merge pull request #11025 from michael-lehew/codable_support_for_nsarchival
NSKeyed{Una,A}rchiver should support Codable
2017-07-19 19:11:57 -07:00
Michael LeHew
ef35a001e6 NSKeyed{Una,A}rchiver should support Codable 2017-07-19 16:43:55 -07:00
Maxim Moiseev
3a1d6e1ebf Merge pull request #10980 from moiseev/uikit-drag-drop
[overlay] Add NSItemProviderReading/Writing methods to UIKit overlay
2017-07-17 10:44:14 -07:00
Max Moiseev
e43f146c5b [overlay] Replace _SwiftDragDropItemProvider with _ObjectiveCBridgeable 2017-07-14 22:47:17 -07:00
Dave Rahardja
340447ac64 [overlay] Add NSItemProvider overlay
<rdar://problem/32138540>
2017-07-14 22:13:30 -07:00
Philippe Hausler
5dfa9160f9 [Foundation] replaceSubrange in the cases of immutable and mutable backing stores should recalculate length per the reference backing store change and not the length of the replacement 2017-07-14 18:34:57 -07:00
Dave Rahardja
1382fc85d7 [overlay] Add NSItemProviderReading/Writing methods to UIKit overlay
<rdar://problem/32138581>
2017-07-14 17:15:58 -07:00
swift-ci
efb7d75489 Merge pull request #10970 from apple/rdar-33307780 2017-07-14 17:14:44 -07:00
Dave Abrahams
e59cb97048 [stdlib/Foundation] Swift 3 backward compatibility hack
Since samePosition(in:) now unconditionally returns optionals,
String.UTF16View.Index.distance(to: String.UTF16View.Index) must accept an
optional to keep some code working.

Fixes <rdar://33307780>.
2017-07-14 15:30:06 -07:00
Maxim Moiseev
16b7de05a3 Merge pull request #10376 from moiseev/foundation-string-extensions
[WIP][overlay] Port Foundation String extensions to StringProtocol
2017-07-13 14:50:47 -07:00
Jordan Rose
1e38b4b624 Merge pull request #10893 from jrose-apple/are-you-having-issues
[stdlib] Surface NSKeyedArchiver issues in Xcode.
2017-07-13 12:53:01 -07:00
Jordan Rose
fd3b585de0 [stdlib] Surface NSKeyedArchiver issues in Xcode.
By calling through to swift_reportToDebugger, Xcode can pick up the
NSKeyedArchiver/Unarchiver issues with Swift classes and display them
in the Issues Navigator. This increases the probability that they'll
be seen and acted upon.

This is not a fully-general interface yet, please do not start hooking
random things up to it. Especially if you're working on something that
doesn't ship with Xcode itself. :-)

rdar://problem/32900735
2017-07-13 11:19:03 -07:00
Maxim Moiseev
4d70a7c4c5 Merge pull request #10856 from moiseev/color-literal-init
[overlay] Hide the _ExpressibleByColorLiteral initizlier from code completion
2017-07-13 10:40:59 -07:00
Brian Croom
f7ee42588b Merge pull request #10905 from briancroom/XCTAssert-continueAfterFailure
Stop swallowing test interruption exceptions thrown during XCTAssert evaluation
2017-07-12 17:22:32 -07:00
Maxim Moiseev
ec77bd01de Merge pull request #10903 from moiseev/metered-fare
[overlay] Add INRideOption
2017-07-12 14:57:18 -07:00
Brian Croom
f788a309ff Stop swallowing test interruption exceptions thrown during XCTAssert evaluation.
Rethrow any test interruption exceptions that get caught, mirroring the
behavior of the Objective-C XCTAssert macros.

<rdar://problem/33255447>
2017-07-12 12:28:34 -07:00
Kyle Zhao
923468be6b [overlay] Add INRideOption
<rdar://problem/32935297>
2017-07-12 11:36:54 -07:00
Max Moiseev
391d49a31e [overlay] Hide the _ExpressibleByColorLiteral initializer from code completion.
Fixes: <rdar://problem/32726800>
2017-07-12 09:05:06 -07:00
Dave Abrahams
69eb4d6fe2 Merge pull request #10785 from xwu/silence-warnings
[gardening] Silence compiler warnings [NFC]
2017-07-11 23:13:30 -07:00
Maxim Moiseev
2e512cb7fe Merge pull request #10865 from moiseev/intents-availability-again
[overlay] Fixing the availability of INSearchCallHistoryIntent.init
2017-07-11 09:13:27 -07:00
Max Moiseev
95d46b1ee0 [overlay] Fixing the availability of INSearchCallHistoryIntent.init
Addresses: <rdar://problem/33206673>
2017-07-10 15:49:54 -07:00
Xiaodi Wu
075948c099 Explicitly discard result of NSDecimal operations 2017-07-10 17:11:42 -05:00
Kyle Zhao
5ab2e4d3a5 [overlay] Change INBooleanResolutionResul.defaultProfile to .isDefaultProfile
<rdar://problem/31816908>
2017-07-10 11:25:09 -07:00
Itai Ferber
acadd6ca32 Merge pull request #10819 from itaiferber/encoders-eliminate-overlapping-exclusive-accesses
Remove overlapping exclusive accesses in encoders
2017-07-07 16:08:17 -07:00
Max Moiseev
1a0436e9c7 [overlay] Use RangeExpression whenever possible instead of Range 2017-07-07 15:34:56 -07:00
Max Moiseev
77edc65003 [overlay] Potentially better bridging to NSString in StringProtocol extensions 2017-07-07 15:34:56 -07:00
Max Moiseev
72479aca50 [overlay] Move static unavailable members back to String 2017-07-07 15:34:56 -07:00
Max Moiseev
5f1c3f7021 [overlay] Generalize Foundation StringProtocol extensions 2017-07-07 15:34:56 -07:00
Max Moiseev
fc0cf33bdc [overlay] Mark Foundation String slicing methods as deprecated 2017-07-07 15:34:56 -07:00
Max Moiseev
fe1ebdfc73 [overlay] Port Foundation extensions from String to StringProtocol 2017-07-07 15:34:08 -07:00
Xiaodi Wu
2c29408430 Merge branch 'master' into silence-warnings 2017-07-07 17:33:55 -05:00
Max Moiseev
f45c1888b6 [overlay] Move unavailable declarations to StringProtocol 2017-07-07 15:29:47 -07:00
Max Moiseev
b2b0dc42d4 [overlay] Extracting static string extensions 2017-07-07 15:29:46 -07:00
Dave Abrahams
076b2e115f Merge pull request #10814 from apple/index-interchange
Index interchange
2017-07-07 15:01:17 -07:00
Itai Ferber
18b523289d Remove overlapping exclusive accesses in encoders
{JSON,Plist}{Encoder,Decoder} had overlapping accesses which were supposed to be mutually exclusive in their `with(pushedKey:)` methods.

Removes those methods and the overlapping accesses.
2017-07-07 13:43:21 -07:00
Itai Ferber
b8dc826d41 Merge pull request #10766 from itaiferber/jsonencoder-conditional-conformance-workarounds
JSONEncoder conditional conformance workarounds
2017-07-07 13:20:54 -07:00
Dave Abrahams
9159239995 Un-revert "[stdlib] String index interchange, etc." (#10812)
I failed to merge the upstream changes to swift-corelibs-foundation at the same
time as I merged that #9806, and it broke on linux. Going to get it right this
time.
2017-07-07 12:13:25 -07:00
Xi Ge
d9fb110674 Revert "[stdlib] String index interchange, etc." (#10812)
rdar://33186295
2017-07-07 12:03:16 -07:00
Itai Ferber
9f7506f002 Allow application of JSON strategies in all cases
One of the limitations of not having conditional conformance at the
moment is that the implementation of `init(from:)` and `encode(to:)` on
types which require it is that failure to cast dependent types to
`Encodable` or `Decodable` is a runtime failure. There is no way to
statically guarantee that the wrapped type is `Encodable` or
`Decodable`.

As such, in those implementations, at best we can directly call
`(element as! Encodable).encode(to: encoder)`, or similar. However, this
encodes the element directly into an encoder, without giving the encoder
a chance to intercept the type. This is problematic for `JSONEncoder`
because it cannot apply a strategy if it doesn't get to intercept the
type.

This gives a temporary workaround for JSON strategies because of
internal Foundation knowledge.
2017-07-07 09:38:07 -07:00
Dave Abrahams
2e0bb2f533 [stdlib] String index interchange, part II (UTF16) 2017-07-07 06:15:23 -07:00
Dave Abrahams
e523c80339 [stdlib] Index interchange, part I 2017-07-07 00:59:04 -07:00
Philippe Hausler
56f509f059 [Foundation] Merge sequence initializer fast paths into one initializer 2017-07-06 19:24:17 -07:00
Philippe Hausler
a842c6d43d [Foundation] Update Data sequence initializer to use initialize(from:) and add _copyContents 2017-07-06 09:45:53 -07:00
Philippe Hausler
aeb61e361b [Foundation] Add fast paths for Data initialization for common sequences 2017-07-06 09:45:53 -07:00