Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylesluder/6057905 to your computer and use it in GitHub Desktop.
Save kylesluder/6057905 to your computer and use it in GitHub Desktop.
// RUN: %clang -fsyntax-only %s 2>&1 | FileCheck %s
#import <Foundation/NSObject.h>
@protocol FooDelegate;
@interface Foo : NSObject
@property (weak) id<FooDelegate> delegate;
@end
@protocol FooDelegate <NSObject>
- (void)doSomething;
@end
@protocol BarDelegate;
@interface Bar : Foo
@property (weak) id<BarDelegate> delegate;
@end
@protocol BarDelegate <FooDelegate>
- (void)anotherMethod;
@end
// CHECK-NOT: warning: property type 'id<BarDelegate>' is incompatible with type 'id<FooDelegate>' inherited from 'Foo'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment