Allow initialized let/var declarations in function builders.#29786
Merged
DougGregor merged 3 commits intoswiftlang:masterfrom Feb 13, 2020
Merged
Allow initialized let/var declarations in function builders.#29786DougGregor merged 3 commits intoswiftlang:masterfrom
DougGregor merged 3 commits intoswiftlang:masterfrom
Conversation
…rget. Pull out the core operation of rewriting a given SolutionApplicationTarget into into a method on the ExprWalker that does the overall rewrite, so it can be called multiple times within application.
When applying a function builder to a closure to produce the final, type-checked closure, use the new rewriteTarget() so it’s performed on a per-target basis. Use this to eliminate some duplicating in the handling of return types.
…n builders.
Introduce support for initialized let/var declarations within function
builder closures, e.g.,
let (a, b) = c()
We generate constraints for the declarations as elsewhere, but the types of
the declared variables (a and b in this case) are bound to the type of the
pattern by one-way constraints, to describe the flow of type information
through the closure.
Implements rdar://problem/57330696.
568ff52 to
2347829
Compare
Member
Author
|
The first two commits are from #29801; only the third commit is needed here. |
Member
Author
|
@swift-ci please smoke test |
Member
Author
|
@swift-ci please test source compatibility |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Introduce support for initialized let/var declarations within function
builder closures, e.g.,
We generate constraints for the declarations as elsewhere, but the types of
the declared variables (a and b in this case) are bound to the type of the
pattern by one-way constraints, to describe the flow of type information
through the closure.
We generate constraints for the declarations as elsewhere, but the types of
the declared variables (a and b in this case) are bound to the type of the
pattern by one-way constraints, to describe the flow of type information
through the closure.
Implements rdar://problem/57330696.