Fixes rdar://problem/21030937, which came about because CNErrorDomain
is missing availability information, so we generate a normal external
reference rather than a weak one.
Swift SVN r28824
We no do not require "self." for closures capturing self in static/class methods.
While we do actually capture the metatype more than we should (rdar://21030087),
this doesn't matter to the developer, since this capture cannot cause a cycle
in the reference graph that they should have to reason about.
Swift SVN r28804
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
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
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
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
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
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
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
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