Commit 04952fd
committed
[TypeChecker] Implement result builder transform via AST modification
The transform changes closure body into a multi-statement closure
with all of the implicit result builder calls and type-checks it
like a regular closure.
There are a couple of result builder specific changes mentioned below,
otherwise the logic to generate constraints and apply solutions is
unchanged:
- Placeholder variable: A variable declaration that doesn't have a
type deduced and infers it from its first use. If such a variable
has an initializer, it would be type-checked during solution application.
- TypeJoinExpr - an implicit expression that refers to a "join" variable
and a set of expressions that should all produce the same type that
becomes a type of a "join" variable.1 parent 7375dcd commit 04952fd
File tree
3 files changed
+1031
-34
lines changed- include/swift/Sema
- lib/Sema
3 files changed
+1031
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4824 | 4824 | | |
4825 | 4825 | | |
4826 | 4826 | | |
| 4827 | + | |
| 4828 | + | |
| 4829 | + | |
| 4830 | + | |
| 4831 | + | |
| 4832 | + | |
| 4833 | + | |
| 4834 | + | |
| 4835 | + | |
| 4836 | + | |
4827 | 4837 | | |
4828 | 4838 | | |
4829 | 4839 | | |
| |||
0 commit comments