mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
results when finding bridged types, rather than reinventing (well, pre-inventing) the same thing elsewhere. Doing this apparently forces AbstractionPattern to deal with ObjC protocol methods for the first time, which are generic and therefore require even the Clang-based abstraction patterns to propagate generic signatures. Use this infrastructure to allow foreign error conventions to suppress the wrapping of nonnull bridged collection results in a level of optionality. We can't treat nil results as an empty collection while simultaneously treating them as an error signal. Swift SVN r28022
20 lines
544 B
Objective-C
20 lines
544 B
Objective-C
/* -*- ObjC -*- */
|
|
|
|
@import Foundation;
|
|
|
|
@interface ErrorProne : NSObject
|
|
+ (BOOL) fail: (NSError**) error;
|
|
+ (BOOL) goAndReturnError: (NSError**) error;
|
|
+ (BOOL) tryAndReturnError: (NSError**) error;
|
|
|
|
+ (BOOL) consume: (id) object error: (NSError**) error;
|
|
|
|
- (instancetype) initWithOne: (nullable id) other error: (NSError**) error;
|
|
+ (instancetype) errorProneWithTwo: (nullable id) other error: (NSError**) error;
|
|
|
|
+ (NSArray*) collectionWithCount: (NSInteger) i error: (NSError**) error;
|
|
@end
|
|
|
|
@interface ReallyErrorProne : ErrorProne
|
|
@end
|