diff options
Diffstat (limited to 'test/SemaObjC/related-result-type-inference.m')
-rw-r--r-- | test/SemaObjC/related-result-type-inference.m | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/SemaObjC/related-result-type-inference.m b/test/SemaObjC/related-result-type-inference.m index 50aaf2d..547e83f 100644 --- a/test/SemaObjC/related-result-type-inference.m +++ b/test/SemaObjC/related-result-type-inference.m @@ -173,7 +173,7 @@ void test_inference() { @interface Fail @end @protocol X @end @implementation Fail -- (id<X>) initWithX +- (id<X>) initWithX // expected-note {{compiler has implicitly changed method 'initWithX' return type}} { return (id)self; // expected-warning {{casting 'Fail *' to incompatible type 'id<X>'}} } @@ -184,3 +184,19 @@ void test_inference() { @interface WeirdNSString : NSString - (id)initWithCString:(const char*)string, void *blah; @end + + +// rdar://14121570 +@protocol PMFilterManager +@end + +@interface UIViewController : NSObject +@end + +@implementation UIViewController ++ (UIViewController<PMFilterManager> *)newFilterViewControllerForType // expected-note {{compiler has implicitly changed method 'newFilterViewControllerForType' return type}} +{ + UIViewController<PMFilterManager> *filterVC; + return filterVC; // expected-warning {{incompatible pointer types casting 'UIViewController *' to type 'UIViewController<PMFilterManager> *'}} +} +@end |