Skip to content

Commit 7e2cdf8

Browse files
authored
Merge pull request swiftlang#67626 from hamishknight/try-without-completion-drop
2 parents 39b81a3 + 6ede5e0 commit 7e2cdf8

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

lib/Sema/CSStep.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -880,21 +880,6 @@ bool ConjunctionStep::attempt(const ConjunctionElement &element) {
880880
CS.Timer.emplace(element.getLocator(), CS);
881881
}
882882

883-
assert(!ModifiedOptions.has_value() &&
884-
"Previously modified options should have been restored in resume");
885-
if (CS.isForCodeCompletion() &&
886-
!element.mightContainCodeCompletionToken(CS) &&
887-
!getLocator()->isForSingleValueStmtConjunctionOrBrace()) {
888-
ModifiedOptions.emplace(CS.Options);
889-
// If we know that this conjunction element doesn't contain the code
890-
// completion token, type check it in normal mode without any special
891-
// behavior that is intended for the code completion token.
892-
// Avoid doing this for SingleValueStmtExprs, because we can more eagerly
893-
// prune branches in that case, which requires us to detect the code
894-
// completion option while solving the conjunction.
895-
CS.Options -= ConstraintSystemFlags::ForCodeCompletion;
896-
}
897-
898883
auto success = element.attempt(CS);
899884

900885
// If element attempt has failed, mark whole conjunction
@@ -906,9 +891,6 @@ bool ConjunctionStep::attempt(const ConjunctionElement &element) {
906891
}
907892

908893
StepResult ConjunctionStep::resume(bool prevFailed) {
909-
// Restore the old ConstraintSystemOptions if 'attempt' modified them.
910-
ModifiedOptions.reset();
911-
912894
// Return from the follow-up splitter step that
913895
// attempted to apply information gained from the
914896
// isolated constraint to the outer context.

lib/Sema/CSStep.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -942,11 +942,6 @@ class ConjunctionStep : public BindingStep<ConjunctionElementProducer> {
942942
/// in isolated mode.
943943
SmallVector<Solution, 4> IsolatedSolutions;
944944

945-
/// If \c ConjunctionStep::attempt modified the constraint system options,
946-
/// it will store the original options in this \c llvm::SaveAndRestore.
947-
/// Upon \c resume, these values will be restored.
948-
llvm::Optional<llvm::SaveAndRestore<ConstraintSystemOptions>> ModifiedOptions;
949-
950945
public:
951946
ConjunctionStep(ConstraintSystem &cs, Constraint *conjunction,
952947
SmallVectorImpl<Solution> &solutions)

0 commit comments

Comments
 (0)