File tree 2 files changed +15
-0
lines changed
compiler/src/dotty/tools/dotc/core
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -3136,6 +3136,14 @@ class TrackingTypeComparer(initctx: Context) extends TypeComparer(initctx) {
3136
3136
3137
3137
def instantiateParams (insts : Array [Type ]) = new ApproximatingTypeMap {
3138
3138
variance = 0
3139
+
3140
+ override def range (lo : Type , hi : Type ): Type =
3141
+ if variance == 0 && (lo eq hi) then
3142
+ // override the default `lo eq hi` test, which removes the Range
3143
+ // which leads to a Reduced result, instead of NoInstance
3144
+ Range (lower(lo), upper(hi))
3145
+ else super .range(lo, hi)
3146
+
3139
3147
def apply (t : Type ) = t match {
3140
3148
case t @ TypeParamRef (b, n) if b `eq` caseLambda => insts(n)
3141
3149
case t : LazyRef => apply(t.ref)
Original file line number Diff line number Diff line change
1
+ trait Show [- A >: Nothing ]
2
+
3
+ type MT1 [I <: Show [Nothing ], N ] = I match
4
+ case Show [a] => N match
5
+ case Int => a
6
+
7
+ val a = summon[MT1 [Show [String ], Int ] =:= String ]
You can’t perform that action at this time.
0 commit comments