langtools/test/tools/javac/generics/UncheckedConstructor.java
author sogoel
Fri, 15 May 2015 16:53:42 -0700
changeset 30721 1024d425d97e
parent 5520 86e4b9a9da40
permissions -rw-r--r--
8074425: Group 13b: golden files for tests in tools/javac/generics dir Reviewed-by: jjg, darcy, mcimadamore

/*
 * @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; }
            });
    }

}