Commit Graph

812 Commits

Author SHA1 Message Date
practicalswift
5c916c0e71 [gardening] "a" vs. "an"-fixes 2016-07-24 21:39:51 +02:00
practicalswift
77b6df5063 [gardening] Normalize character use (use ' and "). 2016-07-24 21:31:02 +02:00
Steve (Numerics) Canon
11baa7a14f Possible fix for label of isTotallyOrdered(below:). 2016-07-22 15:21:21 -04:00
Xin Tong
bbf86865d6 Change unicodescalar to failable
We were using a precondition which crashes the program when invalid input is
provided. We want to provide a way to gracefully check and handle invalid input
or shutdown the program if necessary.

SR-1930
2016-07-21 15:27:13 -07:00
Kevin Perry
2cd5426a2e Use alternate implementation of Data.write() on macOS and iOS versions where the provided implementation would crash
rdar://26278731
2016-07-21 12:07:00 -07:00
Tony Parker
261779243e Add a fix-it for URL.setResourceValues/getResourceValues.
This will help with migration from NSURL to struct URL.

Also, include a bonus unit test for this API.
2016-07-21 10:04:33 -07:00
Michael LeHew
f4f9be562d Merge branch 'master' of https://github.com/apple/swift 2016-07-19 17:06:02 -07:00
Luke Larson
74e0498015 Revert "Update master to build with Xcode 8 beta 3, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs."
This reverts commit 62d1fa760c.
2016-07-19 15:18:17 -07:00
Mishal Shah
62d1fa760c Update master to build with Xcode 8 beta 3, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-07-19 22:31:34 +02:00
Joe
a6dad0091b [SE-0095] Initial parsing implementation for '&' composition syntax
This commit defines the ‘Any’ keyword, implements parsing for composing
types with an infix ‘&’, and provides a fixit to convert ‘protocol<>’

- Updated tests & stdlib for new composition syntax
- Provide errors when compositions used in inheritance.
Any is treated as a contextual keyword. The name ‘Any’
is used emit the empty composition type. We have to
stop user declaring top level types spelled ‘Any’ too.
2016-07-19 12:01:02 -07:00
Philippe Hausler
e9cae7be79 [Foundation] Update CharacterSet and NSCharacterSet punctuationCharacters to more consistent naming
Addresses rdar://problem/26628434 Swift3: "whitespaces"?
2016-07-19 11:09:35 -07:00
Philippe Hausler
e8639fe501 [Foundation] Update UndoManager registerUndo to adopt new naming rules
Addresses rdar://problem/26500390 registerUndoWithTarget in overlay not updated for new API names
2016-07-19 11:04:46 -07:00
Dave Abrahams
b5bc9be6fb <label> body => _ body 2016-07-19 07:05:53 -06:00
Doug Gregor
eb27bb65a7 Merge pull request #3602 from DougGregor/se-0091-operators-in-types
Implement SE-0091: Operators in types
2016-07-19 00:14:04 -07:00
Andrew Trick
73106dd7c3 Rename initialize(with:count:) to initialize(to:count:). (#3601)
As proposed in SE-0107: UnsafeRawPointer.

"with" is considered a vacuous preposition. "to" implies direction.
2016-07-18 23:37:45 -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
Michael Gottesman
fc37603c5f Revert "Implement SE-0118" 2016-07-18 16:44:58 -07:00
Saleem Abdulrasool
3b378f7313 Merge pull request #3582 from compnerd/nullability-portability
stdlib: use the modern spellings for nullability
2016-07-18 16:13:23 -07:00
Michael LeHew
a37120cb61 Ensure internal ObjC classes aren't exposed in archives.
We currently specify a few internal ObjC classes.  This commit ensures that they can not be accidentally exposed (and thus need to be supported) into the future. Luckily, NSData and NSDictionary/NSMutableDictionary already specify classForCoder in a general way. NSCharacterSet does not.

This commit also establishes unit tests to ensure all three types do not regress from this into the future.

Also, for completeness, it ensures classForArchiver and classForKeyedArchiver return appropriately as well.
2016-07-18 14:51:18 -07:00
Dave Abrahams
22c8515558 <label> body => _ body 2016-07-18 14:29:08 -06:00
Saleem Abdulrasool
e582465b0e stdlib: use the modern spellings for nullability
Use the portable spelling for the nullability keywords (_Nullable, _Nonnullable,
_Null_unspecified) rather than the old spelling (__nullable, __nonnullable,
__null_unspecified).  NFC.
2016-07-18 12:23:41 -07:00
Doug Gregor
425138c56e [Foundation overlay] Remove an unsightly semicolon 2016-07-18 10:01:50 -07:00
swift-ci
8ca108521c Merge pull request #3558 from parkera/calendar_timezone_locale 2016-07-17 20:34:07 -07:00
Tony Parker
7bce0c4912 Fix mistake in tvOS availability 2016-07-17 19:43:07 -07:00
swift-ci
0e15183279 Merge pull request #3495 from rudkx/fix-ordered-compare-of-optional 2016-07-17 19:28:34 -07:00
Mark Lacey
599ab76fb8 Remove ordered compare of optional and non-optional.
Safely unwrap two optionals used in the compare that follows.

NFC, but this (or another work-around) will be required if either
SE-0121 or SE-0123 is approved.
2016-07-17 17:45:36 -07:00
Tony Parker
05778cc9ab Improvements to the API of struct URL. 2016-07-17 15:49:40 -07:00
Tony Parker
b96a4af6db Work around importer availability bug 2016-07-17 14:05:14 -07:00
Tony Parker
8e814ac875 New value types for Calendar, TimeZone, and Locale
As part of the extensive work on value types in Foundation this year, we
decided to also add value types for these three key classes. In addition
to adding value semantics, the API was extensively audited to improve
Swift interop (especially Calendar).

rdar://26628184
2016-07-17 09:42:37 -07:00
Andrew Trick
888ff1ae99 Revert "New value types for Calendar, TimeZone, and Locale"
This reverts commit 46a9f57329.

This broke Swift CI, OSS incremental RA:

./swift/stdlib/public/SDK/Foundation/TimeZone.swift:228:45: error: 'NSTimeZone' is not implicitly convertible to 'TimeZone'; did you mean to use 'as' to explicitly convert?
        return lhs._wrapped.isEqual(to: rhs._wrapped)
2016-07-16 18:34:32 -07:00
Tony Parker
46a9f57329 New value types for Calendar, TimeZone, and Locale
As part of the extensive work on value types in Foundation this year, we
decided to also add value types for these three key classes. In addition
to adding value semantics, the API was extensively audited to improve
Swift interop (especially Calendar).

rdar://26628184
2016-07-16 17:58:27 -07:00
Andrew Trick
7b5723b9a5 Revert "New value types for Calendar, TimeZone, and Locale"
This reverts commit 9c1f21bdf0.

This breaks swift-ci for everyone:

stdlib/public/SDK/Foundation/Calendar.swift:426:74: error: 'DateInterval' is only available on iOS 10.0 or newer
    public func dateInterval(of component: Component, for date: Date) -> DateInterval? {
2016-07-16 17:08:06 -07:00
Tony Parker
9c1f21bdf0 New value types for Calendar, TimeZone, and Locale
As part of the extensive work on value types in Foundation this year, we
decided to also add value types for these three key classes. In addition
to adding value semantics, the API was extensively audited to improve
Swift interop (especially Calendar).

rdar://26628184
2016-07-16 15:48:08 -07:00
Michael Gottesman
40e1991e12 Revert "Name and label changes for closure parameters (for review only) (#2981)"
This reverts commit 18406900ba.
2016-07-15 19:45:26 -07:00
Dave Abrahams
18406900ba Name and label changes for closure parameters (for review only) (#2981)
Implement SE-0118 Name and label changes for closure parameters

[SE-0118](https://github.com/apple/swift-evolution/blob/master/proposals/0118-closure-parameter-names-and-labels.md)
2016-07-15 15:31:48 -07:00
Philippe Hausler
e0ca8fbd80 [Foundation] Keep NS Updates due to changes in SE-0086
Second pass at updates for SE-0086 feedback

<rdar://problem/26892977> Make sure NSOrderedSet keeps its NS
<rdar://problem/26880016> NSBundleResourceRequest should keep its NS
<rdar://problem/26892958> Make sure NSAttributedString keeps its NS
<rdar://problem/26653694> NSCoder.decodeTopLevelObjectForKey does not follow naming guidelines
<rdar://problem/27355801> Foundation should have a structural type for TextCheckingResult
<rdar://problem/26770611> NSExpression naming is a bit awkward in swift
<rdar://problem/26653451> NSCoder encodeDataObject is misleading
<rdar://problem/26653653> NSCoder decodeObjectOfClass is redundant
2016-07-15 09:56:21 -07:00
Doug Gregor
f2b12aade5 [SE-0112] Allow bridging from nominal and generic types to NSError.
Previously, a type that conformed to 'Error' could not be bridged to
NSError directly. Rather, one would have to go through the 'Error'
protocol, e.g.,

  myErrorValue as Error as NSError

rather than

  myErrorValue as NSError

Make the latter work.
2016-07-14 16:10:18 -07:00
Kenta Kudo
f6e1608fa8 Update Date.swift 2016-07-14 09:52:46 +09:00
Tony Parker
510e5e17a0 Merge pull request #3486 from xwu/SR-1818
Fix IndexSet intersection and symmetric difference [SR-1818]
2016-07-13 15:34:29 -06:00
Nate Cook
56040ef828 Merge pull request #3494 from natecook1000/nc-indexset-contains
Fix IndexSet.contains(integersIn:) documentation
2016-07-13 12:24:19 -05:00
Nate Cook
f54ad5a1f5 Fix IndexSet.contains(integersIn:) documentation 2016-07-13 11:05:31 -05:00
Xiaodi Wu
c0c704641a Remove unnecessary condition in IndexSetBoundaryIterator 2016-07-12 23:22:23 -05:00
Robert Widmann
c39da37525 Merge pull request #3474 from CodaFi/postminimalist-abstract-expressionism
[SE-0115] Rename *LiteralConvertible protocols to ExpressibleBy*…
2016-07-12 21:08:52 -07:00
Xiaodi Wu
39d7dd27a1 Fix IndexSet intersection and symmetricDifference [SR-1818] 2016-07-12 23:03:37 -05:00
Tony Parker
35dd2462f4 Naming updates and hoists for SE-0086
XMLNodeOptions -> XMLNode.Options
NSTextCheckingTypes -> hoisted into NSTextCheckingResult
URLSessionTaskMetricsResourceFetchType ->
URLSessionTaskMetrics.ResourceFetchType

27235689
26995110
2016-07-12 18:08:39 -07:00
Robert Widmann
f97e5dcb0e [SE-0115][1/2] Rename *LiteralConvertible protocols to ExpressibleBy*Literal. This
change includes both the necessary protocol updates and the deprecation
warnings
suitable for migration.  A future patch will remove the renamings and
make this
a hard error.
2016-07-12 15:25:24 -07:00
Doug Gregor
7718f102c1 [SE-0112] Make userInfo accessible via [String : AnyObject] on imported NSErrors. 2016-07-12 14:10:33 -07:00
Doug Gregor
d53a2f66e9 [SE-0112] Use NSError's user-info value providers to lazily populate NSError 2016-07-12 10:53:52 -07:00
Doug Gregor
1a02de6009 [Foundation] NSURLError drops it's 'NS' prefix. 2016-07-12 10:53:52 -07:00
Doug Gregor
823c24b355 [SE-0112] Rename ErrorProtocol to Error.
This is bullet (5) of the proposed solution in SE-0112, and the last
major piece to be implemented.
2016-07-12 10:53:52 -07:00