Skip to content

[ConstraintSystem] Don't increase the score for unapplied function references if the expression is an argument to #selector. #39831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 21, 2021

Conversation

hborla
Copy link
Member

@hborla hborla commented Oct 20, 2021

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.

Note that a better fix for this is to port over the #selector diagnostics from CSApply to constraint fixes, and not attempt invalid disjunction choices based on the selector kind on the valid code path.

Resolves: rdar://83779014

@hborla
Copy link
Member Author

hborla commented Oct 20, 2021

@swift-ci please test source compatibility

@hborla hborla requested a review from xedin October 20, 2021 07:05
Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth adding what you have in “note” section of the description as a TODO where the score is increased.

…ferences

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.
@hborla hborla force-pushed the invalid-selector-property branch from 00e5950 to beaaee7 Compare October 20, 2021 16:19
overload set for an argument to a method `#selector`.
@hborla hborla marked this pull request as ready for review October 20, 2021 17:29
@hborla
Copy link
Member Author

hborla commented Oct 20, 2021

@swift-ci please test source compatibility

@hborla
Copy link
Member Author

hborla commented Oct 20, 2021

@swift-ci please smoke test

@hborla
Copy link
Member Author

hborla commented Oct 20, 2021

@swift-ci please test Windows platform

@hborla hborla merged commit 0601498 into swiftlang:main Oct 21, 2021
@hborla hborla deleted the invalid-selector-property branch October 21, 2021 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants