Special-case Pattern Binding Decls Created by LLDB #3020
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When LLDB wraps a user-defined expression in the REPL, it takes something like this
and turns it into (very very abstractly)
In the process, it creates an implicit pattern binding and an implicit do block. Of these, only the implicit do is considered by ASTScope lookup to be relevant. This presents a problem when
<expr>
is or contains a closure, as the parameters of that closure are defined within a scope that will never be expanded. Thus,This patch provides the LLDB half of the fix wherein we consume the
infrastructure in the Swift half and readjust the source locations of
the implicit braced block so ASTScope is happy to look up variables
defined in its body.
rdar://78256873