Skip to content

Conversation

@gregomni
Copy link
Contributor

@gregomni gregomni commented Jun 8, 2024

With multiple overload choices, TreatRValueAsLValue used to just pick the first solution. We get better diagnostics if we pick a solution where the chosen VarDecl is settable, if there is one.

I.e. if you conform to two protocols with same-named property, one of which is {get} and the other is {get set} and both possibilities end up with the same fix in the same location, it isn't much help to use the "it's a get-only property" choice.

Resolves #46265

@gregomni
Copy link
Contributor Author

gregomni commented Jun 8, 2024

@swift-ci Please smoke test.

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.

I think it would be better to reflect this in the score at the point where the fix is recorded instead of having to retroactively rank the fixes, this would mean that we can prune solutions more effectively.

@xedin
Copy link
Contributor

xedin commented Jun 9, 2024

Thanks for all the work you have done recently, I will try to take a look at other PRs asap!

@gregomni
Copy link
Contributor Author

gregomni commented Jun 9, 2024

I think it would be better to reflect this in the score at the point where the fix is recorded instead of having to retroactively rank the fixes, this would mean that we can prune solutions more effectively.

Makes sense! I'll look at that.

@gregomni gregomni closed this Jun 9, 2024
@gregomni gregomni force-pushed the rvalue-ambiguous branch from 724d6e6 to b07a2aa Compare June 9, 2024 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants