mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Non-null attributes can indicate non-optionality of pointers. While these non-null attributes are generally less useful than the nullability type specifiers, they are occasionally used in the wild. Addresses rdar://problem/18428099. Swift SVN r23733
23 lines
678 B
Objective-C
23 lines
678 B
Objective-C
#ifndef NULLABILITY_H
|
|
#define NULLABILITY_H
|
|
|
|
typedef __nonnull id nonnull_id;
|
|
|
|
__nullable id getId1(void);
|
|
__nullable nonnull_id getId2(void);
|
|
|
|
extern __nullable id global_id;
|
|
|
|
@interface SomeClass
|
|
- (nonnull id)methodA:(nullable SomeClass *)obj;
|
|
- (nonnull nonnull_id)methodB:(nullable int (^)(int, int))block;
|
|
- (nullable nonnull_id)methodC;
|
|
@property (nullable) nonnull_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)));
|
|
@end
|
|
|
|
#endif
|