@@ -3764,9 +3764,6 @@ object Types {
3764
3764
3765
3765
override def tryNormalize (implicit ctx : Context ): Type = reduced.normalized
3766
3766
3767
- /** Switch to choose parallel or sequential reduction */
3768
- private final val reduceInParallel = false
3769
-
3770
3767
final def cantPossiblyMatch (cas : Type )(implicit ctx : Context ): Boolean =
3771
3768
true // should be refined if we allow overlapping cases
3772
3769
@@ -3783,24 +3780,6 @@ object Types {
3783
3780
else NoType
3784
3781
}
3785
3782
3786
- def reduceParallel (implicit ctx : Context ) = {
3787
- val applicableBranches = cases
3788
- .map(typeComparer.matchCase(scrutinee, _, instantiate = true )(trackingCtx))
3789
- .filter(_.exists)
3790
- applicableBranches match {
3791
- case Nil => NoType
3792
- case applicableBranch :: Nil => applicableBranch
3793
- case _ =>
3794
- record(i " MatchType.multi-branch " )
3795
- ctx.typeComparer.glb(applicableBranches)
3796
- }
3797
- }
3798
-
3799
- def isBounded (tp : Type ) = tp match {
3800
- case tp : TypeParamRef =>
3801
- case tp : TypeRef => ctx.gadt.contains(tp.symbol)
3802
- }
3803
-
3804
3783
def contextInfo (tp : Type ): Type = tp match {
3805
3784
case tp : TypeParamRef =>
3806
3785
val constraint = ctx.typerState.constraint
@@ -3813,27 +3792,26 @@ object Types {
3813
3792
tp.underlying
3814
3793
}
3815
3794
3816
- def updateReductionContext () = {
3795
+ def updateReductionContext (): Unit = {
3817
3796
reductionContext = new mutable.HashMap
3818
3797
for (tp <- typeComparer.footprint)
3819
3798
reductionContext(tp) = contextInfo(tp)
3820
3799
typr.println(i " footprint for $this $hashCode: ${typeComparer.footprint.toList.map(x => (x, contextInfo(x)))}%, % " )
3821
3800
}
3822
3801
3823
- def upToDate =
3802
+ def isUpToDate : Boolean =
3824
3803
reductionContext.keysIterator.forall { tp =>
3825
3804
reductionContext(tp) `eq` contextInfo(tp)
3826
3805
}
3827
3806
3828
3807
record(" MatchType.reduce called" )
3829
- if (! Config .cacheMatchReduced || myReduced == null || ! upToDate ) {
3808
+ if (! Config .cacheMatchReduced || myReduced == null || ! isUpToDate ) {
3830
3809
record(" MatchType.reduce computed" )
3831
3810
if (myReduced != null ) record(" MatchType.reduce cache miss" )
3832
3811
myReduced =
3833
3812
trace(i " reduce match type $this $hashCode" , typr, show = true ) {
3834
3813
try
3835
3814
if (defn.isBottomType(scrutinee)) defn.NothingType
3836
- else if (reduceInParallel) reduceParallel(trackingCtx)
3837
3815
else reduceSequential(cases)(trackingCtx)
3838
3816
catch {
3839
3817
case ex : Throwable =>
0 commit comments