bd9526ecbe
Problem when explicit generic constructor type-arguments are used in conjunction with diamond Reviewed-by: jjg
18 lines
475 B
Java
18 lines
475 B
Java
/*
|
|
* @test /nodynamiccopyright/
|
|
* @bug 7030150
|
|
* @summary Type inference for generic instance creation failed for formal type parameter
|
|
* check that compiler rejects bad number of explicit type-arguments
|
|
* @compile/fail/ref=Neg02.out -XDrawDiagnostics Neg02.java
|
|
*/
|
|
|
|
class Neg02 {
|
|
|
|
static class Foo<X> {
|
|
<T> Foo(T t) {}
|
|
}
|
|
|
|
Foo<Integer> fi1 = new <String, Integer> Foo<>("");
|
|
Foo<Integer> fi2 = new <String, Integer> Foo<Integer>("");
|
|
}
|