1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
2 /* { dg-do compile } */
6 /* Test that you can not declare two methods, in the same protocol,
7 with the same name but conflicting method signatures. */
10 + (int) method1: (int)x; /* { dg-message "previous declaration" } */
11 + (float) method1: (int)x; /* { dg-error "duplicate declaration of method .\\+method1." } */
13 - (int) method2: (int)x; /* { dg-message "previous declaration" } */
14 - (int) method2: (float)x; /* { dg-error "duplicate declaration of method .\\-method2." } */
17 + (int *) method3: (int)x; /* { dg-message "previous declaration" } */
18 + (int *) method3: (int **)x; /* { dg-error "duplicate declaration of method .\\+method3." } */
20 - (id) method4: (id)x; /* { dg-message "previous declaration" } */
21 - (void) method4: (id)x; /* { dg-error "duplicate declaration of method .\\-method4." } */
24 /* We don't test conflicting types between @required and @optional
25 methods, as that is tested in method-conflict-2. */