File tree Expand file tree Collapse file tree 2 files changed +3
-10
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 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
@@ -2232,7 +2232,7 @@ object SymDenotations {
2232
2232
tp match {
2233
2233
case tp @ TypeRef (prefix, _) =>
2234
2234
def foldGlb (bt : Type , ps : List [Type ]): Type = ps match {
2235
- case p :: ps1 => foldGlb(bt & recur(p), ps1)
2235
+ case p :: ps1 => foldGlb(bt & recur(p.stripCapturing ), ps1)
2236
2236
case _ => bt
2237
2237
}
2238
2238
Original file line number Diff line number Diff line change @@ -895,20 +895,13 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
895
895
canWidenAbstract && acc(true , tp)
896
896
897
897
def tryBaseType (cls2 : Symbol ) =
898
- var base = nonExprBaseType(tp1, cls2)
898
+ val base = nonExprBaseType(tp1, cls2)
899
899
if base.exists && (base ne tp1)
900
900
&& (! caseLambda.exists
901
901
|| widenAbstractOKFor(tp2)
902
902
|| tp1.widen.underlyingClassRef(refinementOK = true ).exists)
903
903
then
904
904
def checkBase =
905
- // Strip existing capturing set from base type
906
- base = base.stripCapturing
907
- // Pass capture set of tp1 to base type
908
- tp1 match
909
- case tp1 @ CapturingType (_, refs1) =>
910
- base = CapturingType (base, refs1, tp1.isBoxed)
911
- case _ =>
912
905
isSubType(base, tp2, if tp1.isRef(cls2) then approx else approx.addLow)
913
906
&& recordGadtUsageIf { MatchType .thatReducesUsingGadt(tp1) }
914
907
if tp1.widenDealias.isInstanceOf [AndType ] || base.isInstanceOf [OrType ] then
You can’t perform that action at this time.
0 commit comments