Files
swift-mirror/test/Interpreter/SDK/Inputs/errors.h
Saleem Abdulrasool bdb7901a1c test: modernise nullability attributes (NFC)
Use the modern spelling for the nullability attributes in the test mock
headers.  Currently, this was relying on the predefined macros from
clang to work.  However, those are only available on Darwin targets.
This is needed to make the mock environments more portable.
2017-11-01 23:27:33 -07:00

29 lines
755 B
Objective-C

@import Foundation;
#pragma clang assume_nonnull begin
@protocol ErrorTest
- (nullable id)succeedAndReturnError:(NSError **)error;
- (nullable id)failAndReturnError:(NSError **)error;
@end
static id _Nullable testSucceed(id<ErrorTest> _Nonnull testObj) {
NSError *error = nil;
return [testObj succeedAndReturnError:&error];
}
static id _Nullable testSucceedIgnoringError(id<ErrorTest> _Nonnull testObj) {
return [testObj succeedAndReturnError:NULL];
}
static id _Nullable testFail(id<ErrorTest> _Nonnull testObj) {
NSError *error = nil;
return [testObj failAndReturnError:&error];
}
static id _Nullable testFailIgnoringError(id<ErrorTest> _Nonnull testObj) {
return [testObj failAndReturnError:NULL];
}
#pragma clang assume_nonnull end