File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -757,8 +757,14 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
757
757
if (args1.isEmpty) args2.isEmpty
758
758
else args2.nonEmpty && {
759
759
val v = tparams.head.paramVariance
760
- (v > 0 || isSubType(args2.head, args1.head)) &&
761
- (v < 0 || isSubType(args1.head, args2.head))
760
+ def isSub (tp1 : Type , tp2 : Type ) = tp2 match {
761
+ case tp2 : TypeBounds =>
762
+ tp2.contains(tp1)
763
+ case _ =>
764
+ (v > 0 || isSubType(tp2, tp1)) &&
765
+ (v < 0 || isSubType(tp1, tp2))
766
+ }
767
+ isSub(args1.head, args2.head)
762
768
} && isSubArgs(args1.tail, args2.tail, tparams)
763
769
764
770
/** Test whether `tp1` has a base type of the form `B[T1, ..., Tn]` where
Original file line number Diff line number Diff line change
1
+ class Test [T1 ](val x : T1 ) {
2
+ def invert [El1 , CC1 [X ]](implicit w1 : T1 <:< CC1 [El1 ]) = {
3
+ val buf : CC1 [_] = w1(x)
4
+ ???
5
+ }
6
+ }
You can’t perform that action at this time.
0 commit comments