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