File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 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) {
31363136
31373137 def instantiateParams (insts : Array [Type ]) = new ApproximatingTypeMap {
31383138 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+
31393147 def apply (t : Type ) = t match {
31403148 case t @ TypeParamRef (b, n) if b `eq` caseLambda => insts(n)
31413149 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