Commit Graph

4650 Commits

Author SHA1 Message Date
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
25d9a4fe32 stdlib: protocol extensions: de-underscore filter()
The API was adjusted according to the API review previously.

Swift SVN r28592
2015-05-15 00:37:01 +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
Dmitri Hrybenko
b1b9a91663 stdlib: push Array's specialization of filter() to CollectionType
This way, the specialization is more generally applicable.

Swift SVN r28561
2015-05-14 05:55:20 +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
6274168959 stdlib: move _SequenceDefaultsType extensions to SequenceType
Now compiler supports this arrangement.  It provides a better generated
interface.

Swift SVN r28557
2015-05-14 04:06:48 +00:00
Dmitri Hrybenko
71ef0c2296 stdlib: rearrange declarations to be more logically grouped together
Swift SVN r28556
2015-05-14 04:06:46 +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
Chris Willmore
edce320567 Fix copy-paste error when detecting TVOS simulator environment in stdlib
unit tests.

Swift SVN r28546
2015-05-14 00:35:02 +00:00
Chris Willmore
9ac141e21b Add TVOS device testing support to the Swift project:
* Add --tvos option to swift-ios-test utility
* Mark failing tests appropriately
* Add support for TVOS predicates to stdlib unit tests

<rdar://problem/19854476> Swift: TV OS Testing Support

Swift SVN r28543
2015-05-14 00:12:17 +00:00
Doug Gregor
a1f4be0c2a When mapping bridgeable enums to codes, move availability guard inside the #if.
The availability guard is effectively an assertion; make it so with a
fatalError() to improve runtime performance.

Swift SVN r28533
2015-05-13 21:34:16 +00:00
Doug Gregor
bd526cf19a Use 'internal' rather than 'private' in the Cocoa error domain hack.
Swift SVN r28531
2015-05-13 21:02:43 +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
Joe Groff
c97ba8e914 IRGen: Allow concrete subclasses of generic base classes.
Now that we have lazy metadata accessors for classes and vtable thunking, we don't have any reason to prevent concrete subclasses of generic base classes. Wire up IRGen to lazily instantiate the superclass for concrete derived classes when their metadata is accessed, using a runtime function that installs all the necessary pointers and metadata and registers the fully-initialized class with the ObjC runtime.

Swift SVN r28520
2015-05-13 18:54:03 +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
Dmitri Hrybenko
843d8a4eb7 stdlib: protocol extensions: de-underscore map()
Swift SVN r28502
2015-05-13 01:58:46 +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
efed32e6bc stdlib: indent doc comment per coding style
Swift SVN r28496
2015-05-12 23:17:51 +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
Slava Pestov
fc3f4907de Runtime: get some multi-payload enum reflection
It will bail out for some multi-payload enums but should be good
enough for an Either<T> { case Left(T); case Right(ErrorType) }

Swift SVN r28479
2015-05-12 18:19:35 +00:00
Dmitri Hrybenko
68ef59e37a stdlib: Convert comments to use '- requires:' instead of 'Requires:'.
Tidy misc. comments and markdown along the way.

Patch by Brian Lanier.

Swift SVN r28473
2015-05-12 17:47:11 +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
Dmitri Hrybenko
a8ee15331e Add periods and blank lines between abstracts and discussions.
Patch by Alex Martini.

Swift SVN r28466
2015-05-12 07:39:53 +00:00
Dmitri Hrybenko
1bc7b4c226 Move requirements out of abstracts.
Searched for "/// ..*Requires:" and did manual replacements.

Patch by Alex Martini.

Swift SVN r28465
2015-05-12 07:39:52 +00:00
Dmitri Hrybenko
631a4eff32 Move return descriptions out of abstracts.
Searched for "(?<!- )returns:" and did manual replacements.

Patch by Alex Martini.

Swift SVN r28464
2015-05-12 07:39:51 +00:00
Ted Kremenek
42cccf07b2 Make CFunctionPointer, GeneratorOf, SequenceOf unavailable.
Implements rdar://problem/20477688

Swift SVN r28459
2015-05-12 06:28:02 +00:00
Dmitri Hrybenko
4925bda845 stdlib: make 'first' dynamically dispatched so that it can be made fast
on Dictionary and Set

Swift SVN r28453
2015-05-12 04:46:26 +00:00
Dmitri Hrybenko
33276a4014 stdlib: make _prext_filter() return an Array<Element> for all collections
Swift SVN r28451
2015-05-12 03:02:58 +00:00
Dave Abrahams
ee8daf63d7 Yon semicolon doth offend mine eye
Swift SVN r28450
2015-05-12 01:56:39 +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
Enrico Granata
68ba7a7cfa Revert the reversal of Mirror for Mirror
Third take might be the charm after all



Swift SVN r28443
2015-05-11 21:25:28 +00:00
Dmitri Hrybenko
61214ec55b stdlib: remove Sliceable conformance from String
Swift SVN r28442
2015-05-11 20:58:31 +00:00