Commit Graph

1485 Commits

Author SHA1 Message Date
Doug Gregor
94aafe1f33 De-underscore _MachError, _POSIXError, _NSCocoaError, _NSURLError.
Turns rdar://problem/20536610 into API, per scattered but positive API
review feedback.

Swift SVN r28756
2015-05-19 05:53:36 +00:00
Doug Gregor
bddf134a87 Factor _NSCocoaError into a struct whose values are split across frameworks.
The Cocoa error domain is comprised on error codes from Foundation,
CoreData, and AppKit. Rather than try to collect all of the error
codes into a single enum in Foundation, use a struct that conforms to
ErrorType. Part of rdar://problem/20536610.

Swift SVN r28755
2015-05-19 05:53:34 +00:00
Dmitri Hrybenko
f37b768292 GameKit depends on SceneKit
Swift SVN r28746
2015-05-19 04:28:59 +00:00
Dmitri Hrybenko
4f13143919 Update SDK overlay for nullability annotations in the new SDK
Swift SVN r28739
2015-05-19 01:55:31 +00:00
Dmitri Hrybenko
abc7677337 GameplayKit overlay: adjust to SDK changes
Swift SVN r28738
2015-05-19 01:55:30 +00:00
Dmitri Hrybenko
7556a124f1 SpriteKit depends on AVFoundation
Swift SVN r28701
2015-05-18 08:00:56 +00:00
Dmitri Hrybenko
313701286b stdlib: Various punctuation and markup improvements to the comments.
Patch by Brian Lanier.

Swift SVN r28659
2015-05-16 03:04:51 +00:00
Dmitri Hrybenko
891ac31b43 Remove availability information from WatchKitErrorCode because
The SDK does not have it either, and the compiler does not handle
conditionally-available conformances.

Swift SVN r28657
2015-05-16 01:20:38 +00:00
Dmitri Hrybenko
6048306d3d Add availability information to the WatchKit overlay
Swift SVN r28656
2015-05-16 01:04:10 +00:00
Dmitri Hrybenko
a2096f187c Add the WatchKit overlay
rdar://20438380

Swift SVN r28654
2015-05-16 00:32:42 +00:00
Dmitri Hrybenko
8476af5582 Don't build SDK overlays for frameworks that don't exist on watchOS
Swift SVN r28644
2015-05-15 22:16:37 +00:00
Doug Gregor
1d6602ed73 Add bridging for the Mach error domain.
Swift SVN r28626
2015-05-15 16:53:29 +00:00
Doug Gregor
af6d4c5b6f Map the NSError POSIX domain into our error-handling scheme.
More of rdar://problem/20536610. _POSIXError is underscored because
this work needs to go to API review still.

Now with a proper build condition for _POSIXError on Darwin.

Swift SVN r28625
2015-05-15 16:22:20 +00:00
Ted Kremenek
2c3d0308a3 Revert "Map the NSError POSIX domain into our error-handling scheme."
This is breaking the bots.

Swift SVN r28615
2015-05-15 06:01:48 +00:00
Doug Gregor
1fa59f475a Map the NSError POSIX domain into our error-handling scheme.
More of rdar://problem/20536610. _POSIXError is underscored because
this work needs to go to API review still.

Swift SVN r28613
2015-05-15 05:31:25 +00:00
Dmitri Hrybenko
bb0ab47805 Add more missing dependencies for SDK overlays
Swift SVN r28612
2015-05-15 05:26:17 +00:00
Doug Gregor
c98995047f Add missing WebKit -> AppKit dependency.
Swift SVN r28609
2015-05-15 04:47:51 +00:00
Dmitri Hrybenko
7500da41c7 WatchKit depends on UIKit and CoreGraphics
Swift SVN r28608
2015-05-15 03:59:48 +00:00
Dmitri Hrybenko
d8d50e1815 stdlib: in Array bridging code, use the same pattern as Set and Dictionary use
Also, simplify the code by removing an unused parameter.  NFC.

Swift SVN r28607
2015-05-15 03:44:37 +00:00
Dmitri Hrybenko
db7857c5af GameKit depends on AppKit and UIKit
Swift SVN r28606
2015-05-15 03:37:44 +00:00
Dmitri Hrybenko
9c87e392e9 EventKit depends on AppKit
Swift SVN r28605
2015-05-15 03:27:55 +00:00
Dmitri Hrybenko
815816f4f7 Add more dependencies between SDK overlays
Swift SVN r28603
2015-05-15 02:02:08 +00:00
Dmitri Hrybenko
0d569c8e2d AVFoundation depends on CoreMedia
Swift SVN r28602
2015-05-15 01:50:49 +00:00
Dmitri Hrybenko
8d055ef793 CloudKit depends on CoreLocation
Swift SVN r28601
2015-05-15 01:50:49 +00:00
Dmitri Hrybenko
7c8a394cb1 Move NSObject extensions to the ObjectiveC overlay
NSObject is defined in the ObjectiveC module, not in Foundation.

rdar://20526438

Swift SVN r28591
2015-05-15 00:34:25 +00:00
Doug Gregor
d8d4e498a9 Correct target SDKs for new overlays introduced in r28585.
Swift SVN r28590
2015-05-14 23:21:32 +00:00
Doug Gregor
3561cfc8bd Bridge 15 NSError error domains into their corresponding enums.
Introduce a number of small overlays to bridge the NSError domains for
a number of frameworks into existing imported enums. This batch only
covers cases where there is an existing NS_ENUM describing the codes
for the domain, so we need only extend that enum to provide the
appropriate _BridgedNSError conformance.

This is the bulk of rdar://problem/20536610.

Swift SVN r28585
2015-05-14 22:34:29 +00:00
Doug Gregor
75f88af29a Make NSError error domain enums Equatable and Hashable.
Swift SVN r28568
2015-05-14 16:42:12 +00:00
Doug Gregor
7449c3b6ff Use protocol extensions to eliminate boilerplate in bridged NSError domains.
Swift SVN r28567
2015-05-14 16:42:10 +00:00
Joe Groff
9153e2261d CoreGraphics overlay: Comment that the @transparent definitions really want to be @fragile.
Swift SVN r28566
2015-05-14 15:59:28 +00:00
Doug Gregor
79e93e358c Add _NSURLError enum to cover the NSURLError error domain.
Swift SVN r28564
2015-05-14 06:53:55 +00:00
Doug Gregor
88b679969c Get availability annotations right for NSCocoaError.
Fix the script to not wantonly drop availability annotations, and
update NSCocoError accordingly. Also drop in a reinterpret-casting
rawValue initializer, which matches what we get when importing enums
from C.

Swift SVN r28563
2015-05-14 06:53:52 +00:00
Doug Gregor
cfbe2e0921 Hard-code the Cocoa error domain mapping using the results of a simple script.
Bridging the Cocoa error domain requires us to gather constants from
Foundation, CoreData, and AppKit, then pulling those into a single
(_)NSCocoaError enum that conforms to
_ObjectiveCBridgeableErrorType.

Rather than using a table extracted from the appropriate Cocoa headers
and pushing that through gyb, just hardcode the resuting Swift code,
which is produced (manually) by an enumeration-parsing script. Thanks
to Dave for pointing out that I was holding gyb wrong.

... and apologies for the Perl.

Long term, we need a better solution here, but this will suffice for
the short term.

Swift SVN r28560
2015-05-14 05:39:45 +00:00
Dmitri Hrybenko
9b7ea14bae Disable the CoreImage overlay for watchOS
CoreImage framework is not present in the public watchOS SDK.

Swift SVN r28549
2015-05-14 00:54:02 +00:00
Doug Gregor
7cd80ec5dd Factor creation of enums for the Cocoa error domains into a reusable gyb template.
We'll need these for a number of framework overlays.

Swift SVN r28530
2015-05-13 21:02:41 +00:00
Joe Groff
0b9b9986e3 CoreGraphics overlay: Make most CGPoint/Size/Rect operations transparent (again).
Expose constructors, ==, and other operators so they can be inlined down to
their underlying C struct operations. Add overlays for CG{Point,Rect,Size}Zero
and CGAffineTransformIdentity as well so we avoid having to load from the
opaque extern storage of the C constants. Recommits r28387 and addresses
rdar://problem/20888179, now that the previous commit worked around
rdar://problem/20902115.

Swift SVN r28527
2015-05-13 20:53:29 +00:00
Doug Gregor
ce37291d10 Update NSCocoaError to contain the entire Cocoa domain.
Extend the NSCocoaError enum to cover all of the error codes in the
Cocoa error domain. Note that we need to do something awful for the
AppKit and CoreData errors, effectively redeclaring all of the
constants locally, because we cannot import AppKit and CoreData into
the Foundation overlay. It's not clear whether this blatant layering
violation will stand, but this at least improves coverage.

Also note that there are a number of warnings when building this code,
because some of the availability checks specify availability earlier
than our minimum deployment target. They're harmless and can be
cleaned up later.

Part of rdar://problem/20536610.

Swift SVN r28522
2015-05-13 20:19:45 +00:00
Dmitri Hrybenko
b94c4ce3a4 SDK overlay: add more dependencies for the CoreMedia overlay
Swift SVN r28519
2015-05-13 18:27:12 +00:00
Dmitri Hrybenko
9a81121b59 SDK overlay: there's no GameplayKit in current watchOS, disable it for now
Swift SVN r28506
2015-05-13 03:36:02 +00:00
Ted Kremenek
7f1119f690 Underscore properties of ErrorType.
The internal details of ErrorType are still being designed.
They should be underscored in the meantime to
indicate they are still evolving.

Implements rdar://problem/20927102.

Swift SVN r28500
2015-05-13 00:24:09 +00:00
Dmitri Hrybenko
c8e1ac8435 Add the GameplayKit overlay
Swift SVN r28495
2015-05-12 23:12:06 +00:00
Ted Kremenek
9be9444242 Adjust overlay to CoreImage nullability changes.
Implements rdar://problem/20645743.

Swift SVN r28490
2015-05-12 22:15:03 +00:00
Dmitri Hrybenko
0e52761783 Integrate the CoreMedia overlay for CMTime and CMTimeRange
rdar://19815011

Swift SVN r28489
2015-05-12 22:14:52 +00:00
Ted Kremenek
62feb5c949 Change @availability to @available.
This came out of today's language review meeting.
The intent is to match #available with the attribute
that describes availability.

This is a divergence from Objective-C.

Swift SVN r28484
2015-05-12 20:06:13 +00:00
Dave Abrahams
5c55682d8b [stdlib] Capitalize keywords in doc comments
Again, the text is a lot more readable that way.

Swift SVN r28472
2015-05-12 16:59:13 +00:00
Dave Abrahams
106b39a497 [stdlib] Indent bullet continuations in doc comments
The text is a lot more readable that way.

Swift SVN r28471
2015-05-12 16:59:08 +00:00
Doug Gregor
985896905e Ban generic parameters on extensions.
We no longer allow extensions to provide generic parameters, and the
ability to parse the syntax

  extension Array<String> { ... }

is causing confusion. Fixes rdar://problem/20873336.

Swift SVN r28468
2015-05-12 16:26:04 +00:00
Jordan Rose
d92a039ba7 Make the CoreImage overlay (nee QuartzCore) work for both 10.11 and older OSs.
On OS X 10.10 and earlier, CoreImage is a sub-framework of QuartzCore.
Users of CoreImage use "import QuartzCore" and link against QuartzCore.

On OS X 10.11 (and in the OS X 10.11 SDK), CoreImage is a top-level
framework. Users of CoreImage use "import CoreImage" and would link against
CoreImage. Of course, QuartzCore continues to re-export CoreImage's API.

When backwards-deploying, we need to continue linking against QuartzCore,
but still need to bring in the overlay if you import CoreImage. That's
what this patch does.

rdar://problem/20196610

Swift SVN r28449
2015-05-12 01:29:37 +00:00
Ted Kremenek
64ec51ab85 Convert a few 'var' to 'let' in the SDK overlay.
Swift SVN r28448
2015-05-12 00:24:36 +00:00
Dmitri Hrybenko
61214ec55b stdlib: remove Sliceable conformance from String
Swift SVN r28442
2015-05-11 20:58:31 +00:00