diff options
Diffstat (limited to 'test/SemaObjC/arc-property-decl-attrs.m')
-rw-r--r-- | test/SemaObjC/arc-property-decl-attrs.m | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/SemaObjC/arc-property-decl-attrs.m b/test/SemaObjC/arc-property-decl-attrs.m index 283772c2279c..2d469177723a 100644 --- a/test/SemaObjC/arc-property-decl-attrs.m +++ b/test/SemaObjC/arc-property-decl-attrs.m @@ -79,3 +79,29 @@ @property (readwrite) id frr; @end +// rdar://20152386 +// rdar://20383235 + +@interface NSObject @end + +#pragma clang assume_nonnull begin +@interface I: NSObject +@property(nonatomic, weak) id delegate; // Do not warn, nullable is inferred. +@property(nonatomic, weak, readonly) id ROdelegate; // Do not warn, nullable is inferred. +@property(nonatomic, weak, nonnull) id NonNulldelete; // expected-error {{property attributes 'nonnull' and 'weak' are mutually exclusive}} +@property(nonatomic, weak, nullable) id Nullabledelete; // do not warn + +// strong cases. +@property(nonatomic, strong) id stdelegate; // Do not warn +@property(nonatomic, readonly) id stROdelegate; // Do not warn +@property(nonatomic, strong, nonnull) id stNonNulldelete; // Do not warn +@property(nonatomic, nullable) id stNullabledelete; // do not warn +@end +#pragma clang assume_nonnull end + +@interface J: NSObject +@property(nonatomic, weak) id ddd; // Do not warn, nullable is inferred. +@property(nonatomic, weak, nonnull) id delegate; // expected-error {{property attributes 'nonnull' and 'weak' are mutually exclusive}} +@property(nonatomic, weak, nonnull, readonly) id ROdelegate; // expected-error {{property attributes 'nonnull' and 'weak' are mutually exclusive}} +@end + |