mcimadamore@186: /* jjg@384: * @test /nodynamiccopyright/ mcimadamore@186: * @bug 6723444 mcimadamore@186: * mcimadamore@186: * @summary javac fails to substitute type variables into a constructor's throws clause mcimadamore@186: * @author Mark Mahieu mcimadamore@186: * @compile/fail/ref=T6723444.out -XDstdout -XDrawDiagnostics T6723444.java mcimadamore@186: * mcimadamore@186: */ mcimadamore@186: public class T6723444 { mcimadamore@186: mcimadamore@186: static class Foo { mcimadamore@186: Foo() throws X {} mcimadamore@186: } mcimadamore@186: mcimadamore@186: T6723444() mcimadamore@186: throws X {} mcimadamore@186: mcimadamore@186: T6723444(Foo foo) mcimadamore@186: throws X {} mcimadamore@186: mcimadamore@186: T6723444(Foo foo, int i) mcimadamore@186: throws X1, X2 {} mcimadamore@186: mcimadamore@186: public static void main(String[] args) throws Exception { mcimadamore@186: mcimadamore@186: // the following 8 statements should compile without error mcimadamore@186: mcimadamore@186: Foo exFoo = new Foo(); mcimadamore@186: exFoo = new Foo() {}; mcimadamore@186: mcimadamore@186: new T6723444(); mcimadamore@186: new T6723444() {}; mcimadamore@186: new T6723444(exFoo); mcimadamore@186: new T6723444(exFoo) {}; mcimadamore@186: new T6723444(exFoo, 1); mcimadamore@186: new T6723444(exFoo, 1) {}; mcimadamore@186: mcimadamore@186: // the remaining statements should all raise an mcimadamore@186: // unreported exception error mcimadamore@186: mcimadamore@186: new T6723444(exFoo, 1); mcimadamore@186: new T6723444(exFoo, 1) {}; mcimadamore@186: mcimadamore@186: Foo thFoo = new Foo(); mcimadamore@186: thFoo = new Foo() {}; mcimadamore@186: mcimadamore@186: new T6723444(); mcimadamore@186: new T6723444() {}; mcimadamore@186: new T6723444(thFoo); mcimadamore@186: new T6723444(thFoo) {}; mcimadamore@186: new T6723444(thFoo, 1); mcimadamore@186: new T6723444(thFoo, 1) {}; mcimadamore@186: new T6723444(thFoo, 1); mcimadamore@186: new T6723444(thFoo, 1) {}; mcimadamore@186: } mcimadamore@186: }