aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/nullable-weak-property.m
blob: 617ff4ee5c629ff5477223bc5aaa2554780a02e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -Wnullable-to-nonnull-conversion %s -verify


// rdar://19985330
@interface NSObject @end

@class NSFoo;
void foo (NSFoo * __nonnull);

@interface NSBar : NSObject
@property(weak) NSFoo *property1;
@end

@implementation NSBar 
- (void) Meth {
   foo (self.property1); // expected-warning {{implicit conversion from nullable pointer 'NSFoo * __nullable' to non-nullable pointer type 'NSFoo * __nonnull'}}
}
@end