File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
validation-test/Sema/type_checker_perf/fast Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -299,7 +299,13 @@ static void determineBestChoicesInContext(
299299 if (applicableFn.isNull ()) {
300300 auto *locator = disjunction->getLocator ();
301301 if (auto expr = getAsExpr (locator->getAnchor ())) {
302- if (auto *parentExpr = cs.getParentExpr (expr)) {
302+ auto *parentExpr = cs.getParentExpr (expr);
303+ // Look through optional evaluation, so
304+ // we can cover expressions like `a?.b + 2`.
305+ if (isExpr<OptionalEvaluationExpr>(parentExpr))
306+ parentExpr = cs.getParentExpr (parentExpr);
307+
308+ if (parentExpr) {
303309 // If this is a chained member reference or a direct operator
304310 // argument it could be prioritized since it helps to establish
305311 // 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