File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
validation-test/Sema/type_checker_perf/fast Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,9 @@ static bool isSupportedDisjunction(Constraint *disjunction) {
125
125
// Non-operator disjunctions are supported only if they don't
126
126
// have any generic choices.
127
127
return llvm::all_of (choices, [&](Constraint *choice) {
128
+ if (choice->isDisabled ())
129
+ return true ;
130
+
128
131
if (choice->getKind () != ConstraintKind::BindOverload)
129
132
return false ;
130
133
@@ -314,7 +317,13 @@ static void determineBestChoicesInContext(
314
317
if (applicableFn.isNull ()) {
315
318
auto *locator = disjunction->getLocator ();
316
319
if (auto expr = getAsExpr (locator->getAnchor ())) {
317
- if (auto *parentExpr = cs.getParentExpr (expr)) {
320
+ auto *parentExpr = cs.getParentExpr (expr);
321
+ // Look through optional evaluation, so
322
+ // we can cover expressions like `a?.b + 2`.
323
+ if (isExpr<OptionalEvaluationExpr>(parentExpr))
324
+ parentExpr = cs.getParentExpr (parentExpr);
325
+
326
+ if (parentExpr) {
318
327
// If this is a chained member reference or a direct operator
319
328
// argument it could be prioritized since it helps to establish
320
329
// context for other calls i.e. `(a.)b + 2` if `a` and/or `b`
Original file line number Diff line number Diff line change 1
- // RUN: %target-swift-frontend -typecheck %s -solver-scope-threshold=1000
1
+ // RUN: %target-swift-frontend -typecheck %s -solver-scope-threshold=500
2
2
// REQUIRES: tools-release,no_asan
3
3
4
4
public class Cookie {
You can’t perform that action at this time.
0 commit comments