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(
299
299
if (applicableFn.isNull ()) {
300
300
auto *locator = disjunction->getLocator ();
301
301
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) {
303
309
// If this is a chained member reference or a direct operator
304
310
// argument it could be prioritized since it helps to establish
305
311
// 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