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) {
125125 // Non-operator disjunctions are supported only if they don't
126126 // have any generic choices.
127127 return llvm::all_of (choices, [&](Constraint *choice) {
128+ if (choice->isDisabled ())
129+ return true ;
130+
128131 if (choice->getKind () != ConstraintKind::BindOverload)
129132 return false ;
130133
@@ -314,7 +317,13 @@ static void determineBestChoicesInContext(
314317 if (applicableFn.isNull ()) {
315318 auto *locator = disjunction->getLocator ();
316319 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) {
318327 // If this is a chained member reference or a direct operator
319328 // argument it could be prioritized since it helps to establish
320329 // 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
22// REQUIRES: tools-release,no_asan
33
44public class Cookie {
You can’t perform that action at this time.
0 commit comments