diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
| commit | 13cc256e404620c1de0cbcc4e43ce1e2dbbc4898 (patch) | |
| tree | 2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /test/SemaObjC/method-typecheck-1.m | |
| parent | 657bc3d9848e3be92029b2416031340988cd0111 (diff) | |
Notes
Diffstat (limited to 'test/SemaObjC/method-typecheck-1.m')
| -rw-r--r-- | test/SemaObjC/method-typecheck-1.m | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/SemaObjC/method-typecheck-1.m b/test/SemaObjC/method-typecheck-1.m index ee068d0bfccf8..2d4e868cdf825 100644 --- a/test/SemaObjC/method-typecheck-1.m +++ b/test/SemaObjC/method-typecheck-1.m @@ -34,3 +34,18 @@ (float) x { return 0; } // expected-warning {{conflicting parameter types in implementation of 'setCat:': 'int' vs 'float'}} + (int) cCat: (int) x { return 0; } // expected-warning {{conflicting return type in implementation of 'cCat:': 'void' vs 'int'}} @end + +// rdar://12519216 +// test that when implementation implements method in a category, types match. +@interface testObject {} +@end + +@interface testObject(Category) +- (float)returnCGFloat; // expected-note {{previous definition is here}} +@end + +@implementation testObject +- (double)returnCGFloat { // expected-warning {{conflicting return type in implementation of 'returnCGFloat': 'float' vs 'double'}} + return 0.0; +} +@end |
