File tree 2 files changed +3
-10
lines changed
compiler/src/dotty/tools/dotc/core 2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ import scala.util.control.NonFatal
23
23
import config .Config
24
24
import reporting .*
25
25
import collection .mutable
26
- import cc .{CapturingType , derivedCapturingType }
26
+ import cc .{CapturingType , derivedCapturingType , stripCapturing }
27
27
28
28
import scala .annotation .internal .sharable
29
29
import scala .compiletime .uninitialized
@@ -2228,7 +2228,7 @@ object SymDenotations {
2228
2228
tp match {
2229
2229
case tp @ TypeRef (prefix, _) =>
2230
2230
def foldGlb (bt : Type , ps : List [Type ]): Type = ps match {
2231
- case p :: ps1 => foldGlb(bt & recur(p), ps1)
2231
+ case p :: ps1 => foldGlb(bt & recur(p.stripCapturing ), ps1)
2232
2232
case _ => bt
2233
2233
}
2234
2234
Original file line number Diff line number Diff line change @@ -893,20 +893,13 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
893
893
canWidenAbstract && acc(true , tp)
894
894
895
895
def tryBaseType (cls2 : Symbol ) =
896
- var base = nonExprBaseType(tp1, cls2)
896
+ val base = nonExprBaseType(tp1, cls2)
897
897
if base.exists && (base ne tp1)
898
898
&& (! caseLambda.exists
899
899
|| widenAbstractOKFor(tp2)
900
900
|| tp1.widen.underlyingClassRef(refinementOK = true ).exists)
901
901
then
902
902
def checkBase =
903
- // Strip existing capturing set from base type
904
- base = base.stripCapturing
905
- // Pass capture set of tp1 to base type
906
- tp1 match
907
- case tp1 @ CapturingType (_, refs1) =>
908
- base = CapturingType (base, refs1, tp1.isBoxed)
909
- case _ =>
910
903
isSubType(base, tp2, if tp1.isRef(cls2) then approx else approx.addLow)
911
904
&& recordGadtUsageIf { MatchType .thatReducesUsingGadt(tp1) }
912
905
if tp1.widenDealias.isInstanceOf [AndType ] || base.isInstanceOf [OrType ] then
You can’t perform that action at this time.
0 commit comments