Skip to content

Simplify initialization contexts in the AST #4601

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

Closed

Conversation

DougGregor
Copy link
Member

This PR simplifies and normalizes the handling of initialization contexts in the AST, so parameter with default arguments and initializers of non-local pattern bindings have consistent, descriptive DeclContexts. Should be NFC.

…-local scopes.

We were optimizing away unused pattern binding initializer contexts in
both the parser and in semantic analysis, which led to a
somewhat-unpredictable set of DeclContexts in the AST. Normalize
everything by always creating these contexts.
ExprHandle is a relic from a horrible time when expressions made their
way into the type system via default arguments. It's been unnecessary
for a long time, so get rid of it.
…ault argument.

As with pattern binding initializer contexts, we were trying to
optimize away these contexts, leading to an unpredictable AST.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@DougGregor
Copy link
Member Author

Ended up having to remove an unnecessary #include in LLDB.

@swift-ci please smoke test Linux

@DougGregor DougGregor closed this Sep 2, 2016
@DougGregor DougGregor deleted the simplify-init-contexts branch September 2, 2016 20:51
kateinoigakukun added a commit that referenced this pull request Aug 31, 2022
[pull] swiftwasm from main
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.

1 participant