1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
/*
* @test /nodynamiccopyright/
* @bug 4951260
* @summary compiler disallows raw call to generic constructor
* @author gafter
*
* @compile -Werror UncheckedConstructor.java
* @compile/fail/ref=UncheckedConstructor.out -XDrawDiagnostics -Werror -Xlint:unchecked UncheckedConstructor.java
*/
import java.util.*;
class G3 {
G3(Enumeration<Object> e) { }
static void g() {
new G3(new Enumeration() {
public boolean hasMoreElements() { return false; }
public Object nextElement() { return null; }
});
}
}
|