Files
swift-mirror/test/Inputs/clang-importer-sdk/usr/include/nullability.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

38 lines
1.1 KiB
Objective-C

#ifndef NULLABILITY_H
#define NULLABILITY_H
@import Foundation;
_Nullable id getId1(void);
extern _Nullable id global_id;
@interface SomeClass
- (nonnull id)methodA:(nullable SomeClass *)obj;
- (nonnull id)methodB:(nullable int (^)(int, int))block;
- (nullable id)methodC;
@property (nullable) id property;
- (id)methodD __attribute__((returns_nonnull));
- (void)methodE:(SomeClass *) __attribute__((nonnull)) obj;
- (void)methodF:(SomeClass *)obj second:(SomeClass *)obj2 __attribute__((nonnull));
- (void)methodG:(SomeClass *)obj second:(SomeClass *)obj2 __attribute__((nonnull(1)));
-(nonnull NSString *)stringMethod;
-(nullable NSArray *)optArrayMethod;
+(nonnull instancetype)someClassWithInt:(int)x;
+(nullable SomeClass*)someClassWithDouble:(double)x;
-(nonnull instancetype)returnMe;
@property (null_resettable) NSString *defaultedProperty;
@property (nonnull) NSString *funnyProperty;
-(nullable NSString *)funnyProperty;
-(void)setFunnyProperty:(null_unspecified NSString *)value;
@end
#define NON_NULL_MACRO(...) __attribute__ ((nonnull(__VA_ARGS__)))
void compare_classes(SomeClass *sc1, SomeClass *sc2, SomeClass *sc3) NON_NULL_MACRO(1,2);
#endif