2015-06-20 02:14:38 +08:00
|
|
|
// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -Wnullable-to-nonnull-conversion %s -verify
|
|
|
|
|
|
|
|
|
|
|
|
// rdar://19985330
|
|
|
|
@interface NSObject @end
|
|
|
|
|
|
|
|
@class NSFoo;
|
2015-06-25 06:02:08 +08:00
|
|
|
void foo (NSFoo * _Nonnull);
|
2015-06-20 02:14:38 +08:00
|
|
|
|
|
|
|
@interface NSBar : NSObject
|
|
|
|
@property(weak) NSFoo *property1;
|
|
|
|
@end
|
|
|
|
|
2015-10-10 04:36:17 +08:00
|
|
|
#pragma clang assume_nonnull begin
|
|
|
|
@interface NSBar ()
|
|
|
|
@property(weak) NSFoo *property2;
|
|
|
|
@end
|
|
|
|
|
|
|
|
#pragma clang assume_nonnull end
|
|
|
|
|
2015-06-20 02:14:38 +08:00
|
|
|
@implementation NSBar
|
|
|
|
- (void) Meth {
|
2015-10-10 04:36:17 +08:00
|
|
|
foo (self.property1); // no warning because nothing is inferred
|
|
|
|
foo (self.property2); // expected-warning {{implicit conversion from nullable pointer 'NSFoo * _Nullable' to non-nullable pointer type 'NSFoo * _Nonnull'}}
|
2015-06-20 02:14:38 +08:00
|
|
|
}
|
|
|
|
@end
|