Skip to content

[ConstraintSystem] Handle incorrect key path member references earlier #68048

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 3 commits into from
Aug 23, 2023

Conversation

amritpan
Copy link
Member

These changes move the check for invalid member reference in a keypath out of simplifyKeyPathConstraint and into fixMemberRef so that it can be handled earlier in the typechecking process. Previously, it was skipped in simplifyKeyPathConstraint because the keypath components incorrectly appear to be fully resolved.

if (locator->isForKeyPathDynamicMemberLookup()) {
if (locator->isForKeyPathDynamicMemberLookup() ||
locator->isForKeyPathComponent() ||
locator->isKeyPathSubscriptComponent()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe isKeyPathSubscriptComponent should be folded into isForKeyPathComponent?

@xedin
Copy link
Contributor

xedin commented Aug 22, 2023

@swift-ci please test

@xedin xedin merged commit a7f9182 into swiftlang:main Aug 23, 2023
@amritpan amritpan deleted the kp-refs branch August 25, 2023 05: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