@@ -131,7 +131,7 @@ namespace {
131
131
case SpaceKind::UnknownCase:
132
132
return isAllowedButNotRequired () ? 0 : 1 ;
133
133
case SpaceKind::Type: {
134
- if (!canDecompose (getType (), DC )) {
134
+ if (!canDecompose (getType ())) {
135
135
return 1 ;
136
136
}
137
137
cache.insert (getType ().getPointer ());
@@ -316,14 +316,14 @@ namespace {
316
316
}
317
317
318
318
// (_ : Ty1) <= (_ : Ty2) iff D(Ty1) == D(Ty2)
319
- if (canDecompose (this ->getType (), DC )) {
319
+ if (canDecompose (this ->getType ())) {
320
320
Space or1Space = decompose (DC, this ->getType ());
321
321
if (or1Space.isSubspace (other, DC)) {
322
322
return true ;
323
323
}
324
324
}
325
325
326
- if (canDecompose (other.getType (), DC )) {
326
+ if (canDecompose (other.getType ())) {
327
327
Space or2Space = decompose (DC, other.getType ());
328
328
return this ->isSubspace (or2Space, DC);
329
329
}
@@ -339,15 +339,15 @@ namespace {
339
339
}
340
340
341
341
// (_ : Ty1) <= (S1 | ... | Sn) iff D(Ty1) <= (S1 | ... | Sn)
342
- if (!canDecompose (this ->getType (), DC )) {
342
+ if (!canDecompose (this ->getType ())) {
343
343
return false ;
344
344
}
345
345
Space or1Space = decompose (DC, this ->getType ());
346
346
return or1Space.isSubspace (other, DC);
347
347
}
348
348
PAIRCASE (SpaceKind::Type, SpaceKind::Constructor): {
349
349
// (_ : Ty1) <= H(p1 | ... | pn) iff D(Ty1) <= H(p1 | ... | pn)
350
- if (canDecompose (this ->getType (), DC )) {
350
+ if (canDecompose (this ->getType ())) {
351
351
Space or1Space = decompose (DC, this ->getType ());
352
352
return or1Space.isSubspace (other, DC);
353
353
}
@@ -465,7 +465,7 @@ namespace {
465
465
return *this ;
466
466
}
467
467
PAIRCASE (SpaceKind::Type, SpaceKind::Constructor): {
468
- if (canDecompose (this ->getType (), DC )) {
468
+ if (canDecompose (this ->getType ())) {
469
469
auto decomposition = decompose (DC, this ->getType ());
470
470
return decomposition.minus (other, DC, minusCount);
471
471
} else {
@@ -627,7 +627,7 @@ namespace {
627
627
return (getKind () == SpaceKind::BooleanConstant) ? Space () : *this ;
628
628
}
629
629
630
- if (canDecompose (other.getType (), DC )) {
630
+ if (canDecompose (other.getType ())) {
631
631
auto decomposition = decompose (DC, other.getType ());
632
632
return this ->minus (decomposition, DC, minusCount);
633
633
}
@@ -639,7 +639,7 @@ namespace {
639
639
return *this ;
640
640
641
641
PAIRCASE (SpaceKind::Type, SpaceKind::BooleanConstant): {
642
- if (canDecompose (this ->getType (), DC )) {
642
+ if (canDecompose (this ->getType ())) {
643
643
auto orSpace = decompose (DC, this ->getType ());
644
644
return orSpace.minus (other, DC, minusCount);
645
645
} else {
@@ -781,7 +781,7 @@ namespace {
781
781
// Decompose a type into its component spaces.
782
782
static void decompose (const DeclContext *DC, Type tp,
783
783
SmallVectorImpl<Space> &arr) {
784
- assert (canDecompose (tp, DC ) && " Non-decomposable type?" );
784
+ assert (canDecompose (tp) && " Non-decomposable type?" );
785
785
786
786
if (tp->isBool ()) {
787
787
arr.push_back (Space::forBool (true ));
@@ -844,7 +844,7 @@ namespace {
844
844
return Space::forDisjunct (spaces);
845
845
}
846
846
847
- static bool canDecompose (Type tp, const DeclContext *DC ) {
847
+ static bool canDecompose (Type tp) {
848
848
return tp->is <TupleType>() || tp->isBool () ||
849
849
tp->getEnumOrBoundGenericEnum ();
850
850
}
@@ -1032,7 +1032,7 @@ namespace {
1032
1032
// decompose the type space and offer them as fixits, or simply offer
1033
1033
// to insert a `default` clause.
1034
1034
if (uncovered.getKind () == SpaceKind::Type) {
1035
- if (Space::canDecompose (uncovered.getType (), DC )) {
1035
+ if (Space::canDecompose (uncovered.getType ())) {
1036
1036
SmallVector<Space, 4 > spaces;
1037
1037
Space::decompose (DC, uncovered.getType (), spaces);
1038
1038
diagnoseMissingCases (RequiresDefault::No, Space::forDisjunct (spaces),
0 commit comments