mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ConstraintSystem] Don't increase the score for unapplied function references
if the expression is an argument to `#selector`. For `#selector` arguments, functions and properties are syntactically distinct with the getter/setter label, so the solver should not unconditionally prefer properties to unapplied functions. A better fix for this is to port over the `#selector` diagnostics from CSApply, and not attempt invalid disjunction choices based on the selector kind on the valid code path.
This commit is contained in:
@@ -3464,7 +3464,8 @@ namespace {
|
||||
// Note that the subexpression of a #selector expression is
|
||||
// unevaluated.
|
||||
if (auto sel = dyn_cast<ObjCSelectorExpr>(expr)) {
|
||||
CG.getConstraintSystem().UnevaluatedRootExprs.insert(sel->getSubExpr());
|
||||
auto *subExpr = sel->getSubExpr()->getSemanticsProvidingExpr();
|
||||
CG.getConstraintSystem().UnevaluatedRootExprs.insert(subExpr);
|
||||
}
|
||||
|
||||
// Check an objc key-path expression, which fills in its semantic
|
||||
|
||||
Reference in New Issue
Block a user