1 /*
2  * @test /nodynamiccopyright/
3  * @bug 8157149
4  * @summary Inference: weird propagation of thrown inference variables
5  *
6  * @compile/fail/ref=T8157149a.out -XDrawDiagnostics T8157149a.java
7  */
8 
9 import java.io.IOException;
10 
11 class T8157149a {
m_T()12    <Z extends Throwable> Z m_T() throws Z { return null; }
m_E()13    <Z extends Exception> Z m_E() throws Z { return null; }
14 
test_T()15    void test_T() {
16        Throwable t1 = m_T();
17        Exception t2 = m_T();
18        RuntimeException t3 = m_T();
19        IOException t4 = m_T(); //thrown not caught
20    }
21 
test_E()22    void test_E() {
23        Throwable t1 = m_E();
24        Exception t2 = m_E();
25        RuntimeException t3 = m_E();
26        IOException t4 = m_E(); //thrown not caught
27    }
28 }
29