1 // RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -Wnullable-to-nonnull-conversion %s -verify
3 @interface NSObject @end
6 void foo (NSFoo * _Nonnull);
8 @interface NSBar : NSObject
9 @property(weak) NSFoo *property1;
12 #pragma clang assume_nonnull begin
14 @property(weak) NSFoo *property2;
17 #pragma clang assume_nonnull end
21 foo (self.property1); // no warning because nothing is inferred
22 foo (self.property2); // expected-warning {{implicit conversion from nullable pointer 'NSFoo * _Nullable' to non-nullable pointer type 'NSFoo * _Nonnull'}}