File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ import java .util .*;
2
+
3
+ class WrongBounds {
4
+ class LL <T > extends ArrayList <List <T >> {}
5
+ class Wrap <T extends List <List <?>>> extends ArrayList <T > {}
6
+ class Wrong <T extends LL <?>> extends Wrap <T > {} // error
7
+ }
Original file line number Diff line number Diff line change
1
+ class A
2
+
3
+ class D [T >: A ](v : T ) {
4
+ def getV (): T = v
5
+ }
Original file line number Diff line number Diff line change
1
+ public class J extends D <String > { // error
2
+
3
+ public J () {
4
+ super (null );
5
+ }
6
+
7
+ public static D <String > getDS () { // error
8
+ return new D <String >("DS" );
9
+ }
10
+
11
+ public static final D <String > fieldDS = new D <String >("DS" ); // error
12
+
13
+ public static void useDS (D <String > ds ) {} // error
14
+
15
+ public static <A extends D <String >> void genericDS () {} // error
16
+
17
+ public static void useOK (D <?> ds ) {}
18
+
19
+ public static D <?> getOK () {return null ;}
20
+
21
+ public static <A extends D <?>> D <?> genericOK (A a ) {return a ;}
22
+
23
+ }
You can’t perform that action at this time.
0 commit comments