-
Notifications
You must be signed in to change notification settings - Fork 10.5k
ASTScope: Remove "re-expansion" mechanism #34022
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
ASTScope: Remove "re-expansion" mechanism #34022
Conversation
46d2245
to
4f9a684
Compare
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather keep the member count and put in an assertion as we discussed. The member count would only count explicit members. Otherwise, my feeling is that this change introduces more fragility than my comfort level.
@davidungar I'm planning on switching the call to getMembers() to use getParsedMembers() instead. This evaluates a request which produces a once-allocated ArrayRef which is guaranteed to never change. |
4f9a684
to
af627c2
Compare
af627c2
to
4bbdb95
Compare
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
The subset of the AST that participates in unqualified lookup should be effectively immutable. Delayed parsing can fill in members of nominal types and extensions, as well as function bodies, but since we lazily expand scopes, and the relevant getter methods on IterableDeclContext and AbstractFunctionBody trigger parsing, ASTScope should always see a consistent view of the world.