Skip to content

AST: Rename TypeRefinementContext to AvailabilityScope #77563

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
Nov 12, 2024

Conversation

tshortli
Copy link
Contributor

Clarify the role TypeRefinementContext by renaming it to AvailabilityScope. There are a few reasons for doing this, despite the churn:

  • TypeRefinementContext is a fairly broad name that doesn't provide much of a hint about the primary purpose of this structure for most contributors. Having Availability in the name is clarifying.
  • This better aligns the names of files related to availability checking for code owner rules and file navigation.
  • This infrastructure is already being heavily refactored, so it's a relatively good time to rename it.
  • AvailabilityScope is evocative of ASTScope, which is useful because the two represent very similar concepts and have similar structures.
  • The name "context" is overused in the compiler. Using "scope" instead allows us to use more distinct names in local variables, for example, which can clarify the code.

@tshortli
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@artemcm artemcm left a comment

Choose a reason for hiding this comment

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

Cool!

@@ -1336,9 +1336,9 @@ def dump_scope_maps : Separate<["-"], "dump-scope-maps">,
MetaVarName<"<expanded-or-list-of-line:column>">,
ModeOpt,
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild]>;
def dump_type_refinement_contexts :
Copy link
Contributor

Choose a reason for hiding this comment

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

Please also update Options.swift in swift-driver.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tshortli tshortli force-pushed the rename-type-refinement-context branch from ef7be10 to 67c5927 Compare November 12, 2024 19:34
@tshortli
Copy link
Contributor Author

@swift-ci please smoke test

@tshortli tshortli enabled auto-merge November 12, 2024 19:34
tshortli added a commit to tshortli/swift-driver that referenced this pull request Nov 12, 2024
tshortli added a commit to tshortli/swift-driver that referenced this pull request Nov 12, 2024
@tshortli tshortli merged commit 1e6effd into swiftlang:main Nov 12, 2024
3 checks passed
@tshortli tshortli deleted the rename-type-refinement-context branch November 12, 2024 23:27
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