Skip to content
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

Swift: move keypath dataflow writes to fix types #14865

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rdmarsh2
Copy link
Contributor

This moves the read and write steps on keypath nodes so that the component node is the destination of the read and source of the write, rather than being the source of the read and destination of the write. This means that the type of the dataflow node matches the type that the read/write implies, which will be important when type pruning is added.

@rdmarsh2 rdmarsh2 requested a review from a team as a code owner November 21, 2023 17:11
@github-actions github-actions bot added the Swift label Nov 21, 2023
Copy link
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

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

LGTM once the small comments are addressed (and we have a happy DCA run, of course)

Comment on lines +266 to +269
exists(KeyPathExpr keyPath |
nodeFrom.(KeyPathComponentNodeImpl).getComponent() = keyPath.getComponent(keyPath.getNumberOfComponents() - 1) and
nodeTo.(KeyPathReturnNodeImpl).getKeyPathExpr() = keyPath
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the comment above this disjunct still correct now? It looks like this is now a step from the last component to the return, right?

Comment on lines +276 to +277
// nodeFrom.(KeyPathComponentPostUpdateNode).getComponent() =
// nodeTo.(KeyPathParameterPostUpdateNode).getComponent(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should probably be deleted now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants