Commit Graph

4 Commits

Author SHA1 Message Date
Michael Ilseman
7c9d53a0a0 [Clang Importer] Import ns_error_domain attribute with _BridgedNSError
ns_error_domain can now be used to communicate with the ClangImporter
when an enum has an associated error domain string. In this case, when
we import it as a Swift enum, we can also synthesize a conformance to
_BridgedNSError.

This allows the creation of something like NS_ERROR_ENUM, in which the
developer can declare an enum for the purposes of error handling. Adds
Sema and executable tests demonstrating this funcionality.

In order for the imported ns_error_domain bridging to work, we have to
at some point forcibly pull in a _BridgedNSError conformance, as one
will not be pulled in normally. This is a problem, and is explicitly
signaled in the provided test case
2016-02-04 17:23:28 -08:00
Chris Lattner
e4b6afb9ae Start moving the testsuite to the "_ = foo()" idiom for evaluating an
expression but ignoring its value.  This is the right canonical way to do
this.  NFC, just testsuite changes.



Swift SVN r28638
2015-05-15 20:15:54 +00:00
Joe Groff
2f51838f86 Require macosx for test/ClangModules/enum-new.swift, in keeping with other enum import tests.
Swift SVN r27547
2015-04-22 00:45:16 +00:00
Jordan Rose
b94f7a249e [Importer] Update CF_ENUM detection for changes in Foundation.
...and bump our "Foundation epoch" guard to 3 to match.

Long-term we should switch to an attribute for "yes, this is really a set
of enumerated constants" (and "this is a set of related bitmask options"),
but this unblocks things for now, and doesn't cause any issue if we end
up doing something else.

rdar://problem/20418505

Swift SVN r26944
2015-04-03 18:43:53 +00:00