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