Commit Graph

1358 Commits

Author SHA1 Message Date
Michael Gottesman
fc37603c5f Revert "Implement SE-0118" 2016-07-18 16:44:58 -07:00
Max Moiseev
2facb335bf [overlay] A tentative fix for the intermittent build failures.
It looks from the failed build logs that XCTest has a transitive
dependency on CoreMedia, so listing this dependency explicitly might
solve the problem.
rdar://problem/27404152
2016-07-18 16:14:40 -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
practicalswift
8287c5dfca [gardening] Remove trailing semicolons.
Inspiration: 425138c56e
2016-07-19 00:04:53 +02: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
Matt Wright
11a6dcd2b7 [libdispatch] Remove deprecated methods
* Removes methods introduces in Swift3 that were already marked
    deprecated based on pre-release review feedback.

    Fixes <rdar://problem/26479523>
2016-07-18 13:22:23 -07:00
Matt Wright
8ac413a0b5 [libdispatch] Post-beta API changes and bug fixes
* Fix DispatchSourceSignal initialisation such that it no longer
    registers for the wrong source type.

    * Remove (group:) option from DispatchWorkItem, introduce group
    options to `.async` methods that accept DispatchWorkItem.

    * Rename `DispatchSourceType` to `DispatchSourceProtocol`

    * Rework DispatchQueue attributes and flags into a less confusing
    approach.

    * Fixes:

	SR-1817, SR-1771, SR-1770, SR-1769

	<rdar://problem/26725156> <rdar://problem/26873917>
	<rdar://problem/26918843> <rdar://problem/26810149>
	<rdar://problem/27117023> <rdar://problem/27121422>
	<rdar://problem/27236887> <rdar://problem/27337555>
2016-07-18 13:22:23 -07: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
Chris Lattner
af30ae3222 Remove the last parts of the Boolean protocol, finishing up:
SE-0109: Remove the Boolean protocol.

We still love you George, even if we forgot your e.
2016-07-17 22:18:17 -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
swift-ci
83fee4202b Merge pull request #3565 from parkera/url_improvements 2016-07-17 18:09:20 -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
Chris Lattner
a0d34852bb Revert "Fix the build."
This reverts commit 932fe9d6b9.
2016-07-17 12:35:42 -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
Michael Gottesman
932fe9d6b9 Fix the build.
This reverts commit 4242af7503.
This reverts commit 76cf339694.
This reverts commit e97ed133a8.
This reverts commit 66961fcda8.
2016-07-17 01:02:48 -07:00
Chris Lattner
76cf339694 Implement the first half of SE-0109: Remove the Boolean protocol
This removes conformance of DarwinBool and ObjCBool to the Boolean protocol,
and makes the &&/||/! operators be concrete w.r.t. Bool instead of abstract
on Boolean.

This fixes some outstanding bugs w.r.t diagnostics, but exposes some cases
where an existing diagnostic is not great.  I'll fix that in a later patch
(tracked by rdar://27391581).
2016-07-16 23:23:45 -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
Michael Ilseman
2b3a7a2306 Merge pull request #3516 from milseman/coregraphics
[Core Graphics] Rename several APIs to be more Swifty and consistent
2016-07-15 05:34:18 -07:00
Stephen Canon
cc024d0710 Generic implementations of math functions implementable on FloatingPoint. (#3524)
Replace the non-generic tgmath functions with generic <T: FloatingPoint> implementations where possible, and move the global sqrt() operation into tgmath.
2016-07-15 08:19:08 -04: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
Michael Ilseman
67e58f0c47 [Core Graphics] Rename several APIs to be more Swifty and consistent
This renames several APIs off of CGAffineTransform, CGPoint, CGSize,
CGColor, CGContext, CGRect, and CGColorSpace to have more consistent
names and Swifty names, in accordance with the Swift API Design
Guidelines.

At the same time, we drop many of the special mutating variants from
the overlays, as they are not typical CG usage and a historical
artifact. Test cases added for each.
2016-07-14 13:53:08 -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
Maxim Moiseev
61d1c599e8 [stdlib] Introducing the new Arithmetic protocol (#3479)
* [stdlib] Introducing the new Arithmetic protocol

* [stdlib] conforming floating point types to the new Arithmetic protocol

* [stdlib] removing AbsoluteValuable conformance from floating point types

* [stdlib] removing the integers prototype
2016-07-13 11:35:14 -07:00
Doug Gregor
00bb9d1037 [SE-0112] Associate various error-code enums with their error domains in the SDK. 2016-07-13 11:15:01 -07: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
Doug Gregor
3c40b919ef [SE-0112] Strip the "Code" suffix from imported error types.
The actual code is always the nested type "Code", so it's silly to
have names like "EKErrorCode.Code". Use "EKError.Code" instead.
2016-07-13 00:45:29 -07: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
Doug Gregor
cb8ec8714a [SE-0112] Add typed accessors for various error types and keys.
Introduce typed accesses for the error types of AVFoundation,
CloudKit, Contacts, and CoreLocation. While here, fix the API notes
for the Contacts framework, which had an embarrassingly-wrong file
name ;)
2016-07-12 19:41:52 -07: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