summaryrefslogtreecommitdiffstats
path: root/test/SemaObjC/method-typecheck-3.m
blob: 1999b7d47702e0ad81d40eb868a9e9f9920d1638 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// RUN: %clang_cc1 -Wmethod-signatures -fsyntax-only -verify %s

@class B;
@interface A
- (B*)obj;
- (B*)a; // expected-note {{previous definition is here}}
- (void)takesA: (A*)a; // expected-note {{previous definition is here}}
- (void)takesId: (id)a; // expected-note {{previous definition is here}}
@end


@interface B : A
@end

@implementation B
- (id)obj {return self;} // 'id' overrides are white-listed?
- (A*)a { return self;}  // expected-warning {{conflicting return type in implementation of 'a'}}
- (void)takesA: (B*)a  // expected-warning {{conflicting parameter types in implementation of 'takesA:'}}
{}
- (void)takesId: (B*)a // expected-warning {{conflicting parameter types in implementation of 'takesId:'}}
{}
@end