Debian Codegraph @

framework/tests/all-systems/TypeVars.java

raw
1 class TypeVars {
2
3 class Test1<T> {
4 void m() {
5 @SuppressWarnings("unchecked")
6 T x = (T) new Object();
7
8 Object o = x;
9 }
10
11 class Inner1<X extends T> {}
12
13 public Inner1<T> method1() {
14 return new Inner1<>();
15 }
16 }
17
18 // It's difficult to add more test cases that
19 // should work for all type systems.
20 // Ensure that for the different type systems, annotations
21 // on the type variable are propagated correctly.
22 }