File tree 3 files changed +33
-0
lines changed 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ object Test {
2
+
3
+ class C { type I }
4
+ type A = C
5
+
6
+ def f1 [T ] = classOf [T ] // error
7
+ def f2 [T <: String ] = classOf [T ] // error
8
+ val x = classOf [Test .type ] // error
9
+ val y = classOf [C { type I = String }] // error
10
+ val z = classOf [A ] // ok
11
+ }
Original file line number Diff line number Diff line change
1
+ object unsound {
2
+ trait Bound [A , B <: A ]
3
+ trait Bind [A ] {
4
+ def bad [B <: A ](bound : Bound [A , B ], b : B ) = b
5
+ }
6
+ def coerce [T , U ](t : T ): U = {
7
+ lazy val bound : Bound [U , _ >: T ] = ??? // error: >: T does not conform to upper bound
8
+ def bind = new Bind [U ] {}
9
+ bind.bad(bound, t)
10
+ }
11
+ }
Original file line number Diff line number Diff line change
1
+ trait Out [+ T ]
2
+
3
+ object Test {
4
+
5
+ def foo [T <% AnyRef ](x : T ) = ???
6
+
7
+ var x : Out [_ >: String ] = ???
8
+ var y : Out [String ] = ???
9
+ x = y // should give error, but currently masked by covariant alias representation
10
+ // y = x
11
+ }
You can’t perform that action at this time.
0 commit comments