Skip to content

Commit 0b173de

Browse files
authored
Merge pull request #11338 from rudkx/bail-on-too-complex
Remove -swift-version 3 checks for "expression too complex".
2 parents 8fa2b96 + 9e7b5b2 commit 0b173de

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

lib/Sema/CSSolver.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,8 +1342,7 @@ ConstraintSystem::solve(Expr *&expr,
13421342
// had found at least one solution before deciding an expression was
13431343
// "too complex". Maintain that behavior, but for Swift > 3 return
13441344
// Unsolved in these cases.
1345-
auto tooComplex = getExpressionTooComplex(solutions) &&
1346-
!getASTContext().isSwiftVersion3();
1345+
auto tooComplex = getExpressionTooComplex(solutions);
13471346
auto unsolved = tooComplex || solutions.empty();
13481347

13491348
return unsolved ? SolutionKind::Unsolved : SolutionKind::Solved;
@@ -1876,9 +1875,7 @@ bool ConstraintSystem::solveSimplified(
18761875
// not allow our caller to continue as if we have been successful.
18771876
// Maintain the broken behavior under Swift 3 mode though, to avoid
18781877
// breaking code.
1879-
auto tooComplex = getExpressionTooComplex(solutions) &&
1880-
!getASTContext().isSwiftVersion3();
1881-
1878+
auto tooComplex = getExpressionTooComplex(solutions);
18821879
return tooComplex || !lastSolvedChoice;
18831880
}
18841881

test/Misc/expression_too_complex.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-typecheck-verify-swift -solver-memory-threshold 12000 -propagate-constraints
1+
// RUN: %target-typecheck-verify-swift -solver-memory-threshold 16000 -propagate-constraints
22

33
var z = 10 + 10 // expected-error{{expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions}}
44

0 commit comments

Comments
 (0)