Lines 39409-39415
Link Here
|
39409 |
"----------\n"); |
39409 |
"----------\n"); |
39410 |
} |
39410 |
} |
39411 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=204534 |
39411 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=204534 |
39412 |
public void _test1181() { |
39412 |
public void test1181() { |
39413 |
this.runNegativeTest( |
39413 |
this.runNegativeTest( |
39414 |
new String[] { |
39414 |
new String[] { |
39415 |
"X.java", |
39415 |
"X.java", |
Lines 39430-39436
Link Here
|
39430 |
" }\n" + |
39430 |
" }\n" + |
39431 |
"}\n", // ================= |
39431 |
"}\n", // ================= |
39432 |
}, |
39432 |
}, |
39433 |
"should not see errors like: R cannot be resolved to a type"); |
39433 |
"----------\n" + |
|
|
39434 |
"1. ERROR in X.java (at line 2)\n" + |
39435 |
" public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" + |
39436 |
" ^\n" + |
39437 |
"Cannot specify any additional bound T when first bound is a type parameter\n" + |
39438 |
"----------\n" + |
39439 |
"2. ERROR in X.java (at line 2)\n" + |
39440 |
" public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" + |
39441 |
" ^^^^^^^^^^^^^^^^^^^\n" + |
39442 |
"Method max(T, S) has the same erasure max(Comparable<T>, Object) as another method in type X\n" + |
39443 |
"----------\n" + |
39444 |
"3. WARNING in X.java (at line 3)\n" + |
39445 |
" return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" + |
39446 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
39447 |
"Type safety: Unchecked cast from Object to R\n" + |
39448 |
"----------\n" + |
39449 |
"4. ERROR in X.java (at line 6)\n" + |
39450 |
" public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" + |
39451 |
" ^^^^^^^^^^\n" + |
39452 |
"Cannot specify any additional bound Comparable<S> when first bound is a type parameter\n" + |
39453 |
"----------\n" + |
39454 |
"5. ERROR in X.java (at line 6)\n" + |
39455 |
" public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" + |
39456 |
" ^^^^^^^^^^^^^^^^^^^\n" + |
39457 |
"Method max(T, S) has the same erasure max(Comparable<T>, Object) as another method in type X\n" + |
39458 |
"----------\n" + |
39459 |
"6. WARNING in X.java (at line 7)\n" + |
39460 |
" return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" + |
39461 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
39462 |
"Type safety: Unchecked cast from Object to R\n" + |
39463 |
"----------\n" + |
39464 |
"7. WARNING in X.java (at line 11)\n" + |
39465 |
" return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" + |
39466 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
39467 |
"Type safety: Unchecked cast from Object to R\n" + |
39468 |
"----------\n"); |
39434 |
} |
39469 |
} |
39435 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=204536 |
39470 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=204536 |
39436 |
public void test1182() { |
39471 |
public void test1182() { |