File: T8157149a.java

package info (click to toggle)
libnb-javaparser-java 9%2B2018-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 65,320 kB
  • sloc: java: 440,096; xml: 6,359; sh: 865; makefile: 314
file content (28 lines) | stat: -rw-r--r-- 703 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * @test /nodynamiccopyright/
 * @bug 8157149
 * @summary Inference: weird propagation of thrown inference variables
 *
 * @compile/fail/ref=T8157149a.out -XDrawDiagnostics T8157149a.java
 */

import java.io.IOException;

class T8157149a {
   <Z extends Throwable> Z m_T() throws Z { return null; }
   <Z extends Exception> Z m_E() throws Z { return null; }

   void test_T() {
       Throwable t1 = m_T();
       Exception t2 = m_T();
       RuntimeException t3 = m_T();
       IOException t4 = m_T(); //thrown not caught
   }

   void test_E() {
       Throwable t1 = m_E();
       Exception t2 = m_E();
       RuntimeException t3 = m_E();
       IOException t4 = m_E(); //thrown not caught
   }
}