Lines 48399-48402
Link Here
|
48399 |
"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" + |
48399 |
"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" + |
48400 |
"----------\n"); |
48400 |
"----------\n"); |
48401 |
} |
48401 |
} |
|
|
48402 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=258039 |
48403 |
public void test1431() throws Exception { |
48404 |
this.runNegativeTest( |
48405 |
new String[] { |
48406 |
"X.java", //================================= |
48407 |
"public class X {\n" + |
48408 |
" void foo() {\n" + |
48409 |
" class M<T extends Number> {}\n" + |
48410 |
" class N extends M<String> {}\n" + |
48411 |
" class O implements I<String>, I<Number> {}\n" + |
48412 |
" }\n" + |
48413 |
" class MM<T extends Number> {}\n" + |
48414 |
" class NN extends MM<String> {}\n" + |
48415 |
" class OO implements I<String>, I<Number> {}\n" + |
48416 |
"}\n" + |
48417 |
"interface I<T> {}" |
48418 |
}, |
48419 |
"----------\n" + |
48420 |
"1. ERROR in X.java (at line 4)\n" + |
48421 |
" class N extends M<String> {}\n" + |
48422 |
" ^^^^^^\n" + |
48423 |
"Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends Number> of the type M<T>\n" + |
48424 |
"----------\n" + |
48425 |
"2. ERROR in X.java (at line 5)\n" + |
48426 |
" class O implements I<String>, I<Number> {}\n" + |
48427 |
" ^\n" + |
48428 |
"The interface I cannot be implemented more than once with different arguments: I<Number> and I<String>\n" + |
48429 |
"----------\n" + |
48430 |
"3. ERROR in X.java (at line 8)\n" + |
48431 |
" class NN extends MM<String> {}\n" + |
48432 |
" ^^^^^^\n" + |
48433 |
"Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends Number> of the type X.MM<T>\n" + |
48434 |
"----------\n" + |
48435 |
"4. ERROR in X.java (at line 9)\n" + |
48436 |
" class OO implements I<String>, I<Number> {}\n" + |
48437 |
" ^^\n" + |
48438 |
"The interface I cannot be implemented more than once with different arguments: I<Number> and I<String>\n" + |
48439 |
"----------\n" |
48440 |
); |
48441 |
} |
48402 |
} |
48442 |
} |