Skip to content

[CS] Clean up pack expansion environment handling a little #79529

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 4 commits into from
Feb 21, 2025

Conversation

hamishknight
Copy link
Contributor

  • Track environments for PackExpansionExpr directly instead of using a locator.
  • Split up the querying and creation of the environment such that the mismatch logic can be done directly in CSSimplify instead of duplicating it.
  • Just store the environment directly instead of the shape and UUID.

Should be NFC

IMO "environment" is confusable for GenericEnvironment,
make it clearer it's referring to the parent
PackExpansionExpr.
Resolve a couple of FIXMEs by using `dumpAnchor` to
dump a couple of ASTNodes. This uses the same
compact representation as used in ConstraintLocator
dumping.
- Track environments for `PackExpansionExpr` directly
instead of using a locator.
- Split up the querying and creation of the environment
such that the mismatch logic can be done directly in
CSSimplify instead of duplicating it.
- Just store the environment directly instead of
the shape and UUID.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please test source compatibility

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.

Looks reasonable to me!

Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

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

Trail changes LGTM!

// FIXME: Print short form of ASTNode
out << "(RecordedContextualInfo)\n";
out << "(RecordedContextualInfo ";
dumpAnchor(Node.Node, &SM, out);
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh cute!

@hamishknight hamishknight merged commit 25fa312 into swiftlang:main Feb 21, 2025
7 checks passed
@hamishknight hamishknight deleted the small-cleanup branch February 21, 2025 14:17
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.

3 participants