Skip to content

[CS] Don't adjust opened types of @dynamicMemberLookup overloads #28694

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
Dec 11, 2019

Conversation

hamishknight
Copy link
Contributor

Rather than adjusting the opened types for choices referring to subscript(dynamicMember:) down to the result type, only use the result type to bind the overload type variable. This avoids the need for a couple of special cases in CSApply.

To facilitate this change, add ConstraintSystem::bindOverload, which deals with adding the necessary constraints to bind the overload's type variable. The eventual goal here is to remove adjustTypeOfOverloadReference, with adjustments to the opened type being moved to getTypeOfMemberReference, and the adding of constraints being moved to bindOverloadType.

Rather than adjusting the opened types for choices
referring to `subscript(dynamicMember:)` down to
the result type, only use the result type to
bind the overload type variable. This avoids the
need for a couple of special cases in CSApply.

To facilitate this change, add
`ConstraintSystem::bindOverload`, which deals with
adding the necessary constraints to bind the
overload's type variable. The eventual goal here
is to remove `adjustTypeOfOverloadReference`, with
adjustments to the opened type being moved to
`getTypeOfMemberReference`, and the adding of
constraints being moved to `bindOverloadType`.
Now that overload binding for dynamic member
lookup occurs after having recorded the
`subscript(dynamicMember:)` overload, we can
attempt simplification of this constraint right
away.
@hamishknight hamishknight requested a review from xedin December 11, 2019 02:04
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please test source compatibility

@hamishknight hamishknight merged commit a6168a9 into swiftlang:master Dec 11, 2019
@hamishknight hamishknight deleted the waiting-for-the-results branch December 11, 2019 15:56
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