@@ -2731,14 +2731,6 @@ bool ConstraintSystem::diagnoseAmbiguity(Expr *expr,
2731
2731
return false ;
2732
2732
}
2733
2733
2734
- // / Given a subpath of an old locator, compute its summary flags.
2735
- static unsigned recomputeSummaryFlags (ConstraintLocator *oldLocator,
2736
- ArrayRef<LocatorPathElt> path) {
2737
- if (oldLocator->getSummaryFlags () != 0 )
2738
- return ConstraintLocator::getSummaryFlagsForPath (path);
2739
- return 0 ;
2740
- }
2741
-
2742
2734
ConstraintLocator *
2743
2735
constraints::simplifyLocator (ConstraintSystem &cs, ConstraintLocator *locator,
2744
2736
SourceRange &range) {
@@ -2752,10 +2744,12 @@ constraints::simplifyLocator(ConstraintSystem &cs, ConstraintLocator *locator,
2752
2744
return locator;
2753
2745
}
2754
2746
2755
- // Recompute the summary flags if we had any to begin with. This is
2756
- // necessary because we might remove e.g. tuple elements from the path.
2757
- unsigned summaryFlags = recomputeSummaryFlags (locator, path);
2758
- return cs.getConstraintLocator (anchor, path, summaryFlags);
2747
+ // If the old locator didn't have any summary flags, neither will the
2748
+ // simplified version, as it must contain a subset of the path elements.
2749
+ if (locator->getSummaryFlags () == 0 )
2750
+ return cs.getConstraintLocator (anchor, path, /* summaryFlags*/ 0 );
2751
+
2752
+ return cs.getConstraintLocator (anchor, path);
2759
2753
}
2760
2754
2761
2755
void constraints::simplifyLocator (Expr *&anchor,
0 commit comments