1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
2 /* { dg-do compile } */
6 /* Test that the compiler can correctly compare protocols in types of
7 method signatures. In this test we look at protocols implementing
8 other protocols. The fact that one protocol implements another one
9 doesn't mean that they are identical. */
16 - (void) doSomethingElse;
20 - (void) doYetSomethingElse;
24 - (void) aMethod: (id <A>)x; /* { dg-message "previous declaration" } */
25 - (void) aMethod: (id <B>)x; /* { dg-error "duplicate declaration" } */
27 - (void) bMethod: (id <B>)x; /* { dg-message "previous declaration" } */
28 - (void) bMethod: (id <A>)x; /* { dg-error "duplicate declaration" } */
30 - (void) cMethod: (id <A, B>)x;
31 - (void) cMethod: (id <B>)x; /* Ok - because if you implement B, then you also implement A, so <B> == <A, B> */
33 - (void) dMethod: (id <A, B>)x;
34 - (void) dMethod: (id <B, A>)x; /* Ok */
36 - (void) eMethod: (id <A>)x; /* { dg-message "previous declaration" } */
37 - (void) eMethod: (id <B, C>)x; /* { dg-error "duplicate declaration" } */
39 - (void) fMethod: (id <B, C>)x; /* { dg-message "previous declaration" } */
40 - (void) fMethod: (id <A>)x; /* { dg-error "duplicate declaration" } */
42 - (void) gMethod: (id <A>)x; /* { dg-message "previous declaration" } */
43 - (void) gMethod: (id <A, B, C>)x; /* { dg-error "duplicate declaration" } */
45 - (void) hMethod: (id <A, B, C>)x; /* { dg-message "previous declaration" } */
46 - (void) hMethod: (id <A>)x; /* { dg-error "duplicate declaration" } */