Pavel Yaskevich
b01d21b1ec
[BuilderTransform] NFC: Correctly indent transformed body debug printing
2022-12-21 12:18:02 -08:00
Pavel Yaskevich
529269946d
[AST] Drop ResultBuilderASTTransform feature flag
2022-12-21 12:18:02 -08:00
Alex Hoppen
3c90c892e9
[CodeCompletion] Drop ForCodeCompletion constraint system option for syntactic elements that don't contain completion token
2022-12-21 12:17:56 -08:00
Alex Hoppen
c03addb1e0
[CodeCompletion] Insert code completion token into build block call to retrieve contextual type
...
rdar://94224692
2022-12-21 10:31:46 -08:00
Alex Hoppen
fe2ae72ad2
[IDE] Rename CodeCompletion to IDEInspection in cases where the code path no longer exclusively applies to code completion
...
The code completio infrastructure is also being used for cursor info now, so it should no longer be called code completion.
rdar://103251187
2022-12-13 11:41:05 +01:00
Pavel Yaskevich
6b3776456c
Merge pull request #62053 from abdulowork/improve-type-checker-debugging-indentation
...
Improve indentation in type checker debugging output
2022-11-30 12:11:27 -08:00
Pavel Yaskevich
2e0cc04ba1
Merge pull request #62227 from xedin/result-builder-ast-transform-direct-buildBlock
...
[ResultBuilder] ASTTransform: Don't capture buildBlock into a separat…
2022-11-28 10:18:53 -08:00
Pavel Yaskevich
8060fa0844
[ResultBuilder] ASTTransform: Don't capture buildBlock into a separate variable
...
Inject `buildBlock` call into `return`, `buildFinalResult`, and
`build{Optional, Either}` to take advantage of contextual information
and maintain compatibility with current inference behavior.
2022-11-22 11:42:18 -08:00
Erik Eckstein
ab1b343dad
use new llvm::Optional API
...
`getValue` -> `value`
`getValueOr` -> `value_or`
`hasValue` -> `has_value`
`map` -> `transform`
The old API will be deprecated in the rebranch.
To avoid merge conflicts, use the new API already in the main branch.
rdar://102362022
2022-11-21 19:44:24 +01:00
Timofey Solonin
3f366947e4
Improve indentation in debugging output
2022-11-17 23:25:31 +08:00
Hamish Knight
1846276a13
[CS] Factor out brace element handling in a couple of cases
...
Split out brace element handling for a couple of
walkers into a new function. The diff for this is
best viewed without whitespace changes. This
should be NFC.
2022-11-14 20:03:41 +00:00
Pavel Yaskevich
480bccae55
[BuilderTransform] Lift all restrictions from variable decls when AST transform is enabled
...
Result builders would be able to declare:
- uninitialized variables
- variables with property wrappers (with and without explicit initializer)
- default initializable variables i.e. `var x: Int?`
- computed variables
- `lazy` variables
2022-10-04 13:28:17 -07:00
Ben Barham
79b0cd60a8
[Sema] Skip adding solutions to completion callback if needed
...
If `CompletionContextFinder` fails to find a `CompletionNode`, skip
trying to filter and add solutions to the completion callback. This
prevents an assertion/crash in `filterSolutionsForCodeCompletion` which
assumes `CompletionNode` is non-null (either an expression or keypath).
Resolves rdar://99966094.
2022-09-16 11:39:39 -07:00
Hamish Knight
4716f61fba
[AST] Introduce explicit actions for ASTWalker
...
Replace the use of bool and pointer returns for
`walkToXXXPre`/`walkToXXXPost`, and instead use
explicit actions such as `Action::Continue(E)`,
`Action::SkipChildren(E)`, and `Action::Stop()`.
There are also conditional variants, e.g
`Action::SkipChildrenIf`, `Action::VisitChildrenIf`,
and `Action::StopIf`.
There is still more work that can be done here, in
particular:
- SourceEntityWalker still needs to be migrated.
- Some uses of `return false` in pre-visitation
methods can likely now be replaced by
`Action::Stop`.
- We still use bool and pointer returns internally
within the ASTWalker traversal, which could likely
be improved.
But I'm leaving those as future work for now as
this patch is already large enough.
2022-09-13 10:35:29 +01:00
Allan Shortlidge
f5f1d3c028
AST: Parse #_hasSymbol
...
Introduce the compiler directive `#_hasSymbol` which will be used to detect whether weakly linked symbols are present at runtime. It is intended for use in combination with `@_weakLinked import` or `-weak-link-at-target`.
```
if #_hasSymbol(foo(_:)) {
foo(42)
}
```
Parsing only; SILGen is coming in a later commit.
Resolves rdar://99342017
2022-09-08 17:15:29 -07:00
Pavel Yaskevich
87816457c1
[BuilderTransform] AST Transform: Inject buildOptional to top-level if else conditions
...
Fixes a bug in `buildOptional` injection for `if else` branches
without unconditional `else` which leaves type-join with just `.some(...)`
and results in optionality mismatch if `buildOptional` don't not produce
an optional type.
2022-09-01 13:31:00 -07:00
Hamish Knight
db2a9a470b
Merge pull request #60803 from hamishknight/part-and-partial
2022-08-31 14:57:53 +01:00
Holly Borla
ca08b56fd3
Merge pull request #60844 from hborla/generic-result-builder
...
[ConstraintSystem] Before applying the result builder transform to a function body, map the result builder type into context.
2022-08-30 08:06:58 -07:00
Holly Borla
8ba51888c6
[ConstraintSystem] Before applying the result builder transform to a
...
function body, map the result builder type into context.
This was already done for inferred result builder attributes; now,
the constraint system will map the builder type into context for all
result builder attributes applied to computed properties/functions.
2022-08-29 22:13:13 -07:00
Hamish Knight
cebcbb0767
[CS] Improve diagnostics when buildPartialBlock is unavailable
...
If `buildBlock` is also unavailable, or the
builder itself is unavailable, continue to solve
using `buildPartialBlock` to get better
diagnostics.
This behavior technically differs from what is
specified in SE-0348, but only affects the invalid
case where no builder methods are available to use.
In particular, this improves diagnostics for
RegexComponentBuilder when the deployment target
is too low. Previously we would try to solve using
`buildBlock` (as `buildPartialBlock` is unavailable),
but RegexComponentBuilder only defines `buildBlock`
for the empty body case, leading to unhelpful
diagnostics that ultimately preferred not to use
the result builder at all.
rdar://97533700
2022-08-26 19:45:03 +01:00
Hamish Knight
dd1da22b16
[CS] Separate availability checking from SupportedOps cache
...
Previously we would cache the result of the first
query, with any further query of
`ResultBuilder::supports` ignoring the
`checkAvailability` parameter. Separate out the
availability checking such that we compute the
information up front, and adjust the result
depending on `checkAvailability`.
2022-08-26 19:45:02 +01:00
Suyash Srijan
390d8cc44b
[IDE] Add result builder code completion for buildPartialBlock ( #60669 )
2022-08-20 15:36:15 +01:00
Pavel Yaskevich
93417d9f94
Merge pull request #60495 from amritpan/refactor-solver-state-indents
...
[ConstraintSystem] NFC: Refactor solver state depth to its own function fo…
2022-08-11 00:30:09 -07:00
Ben Barham
a59fa46813
Merge pull request #60426 from bnbarham/include-smallvec
...
[Basic] Include SmallVector.h for Clang <= 5
2022-08-10 15:54:48 -07:00
Amritpan Kaur
fd41a39294
[ConstraintSystem] Refactor solver state depth to its own function for easier indent editing in future.
2022-08-10 13:29:02 -07:00
Pavel Yaskevich
2ebc7a266c
Merge pull request #60449 from xedin/dont-erase-result-during-transform
...
[ResultBuilder] AST transform: don't try type erasure of result expressions
2022-08-09 11:30:06 -07:00
Pavel Yaskevich
422dbe493a
[ResultBuilder] AST transform: don't try type erasure of result expressions
...
Constraint generation is going to erase when appropriate and rewrite the target,
no need to do that explicitly during result builder transform.
2022-08-08 13:43:28 -07:00
Pavel Yaskevich
b39302a585
Merge pull request #60203 from xedin/rdar-96997534
...
[CSGen] Allow `_` pattern to be a hole
2022-08-08 10:14:18 -07:00
Ben Barham
6de34f37e5
[NFC] Revert SmallVector<T> -> SmallVector<T, N> fixes
...
With the change to include `SmallVector.h` directly in `LLVM.h` rather
than forward declaring in the only case it matters (ie. Clang <= 5),
these fixes are no longer needed. Since defaulted version is preferred
when there's no better choice (which is presumably the case if that's
how they were originally added), use it instead. Some uses were instead
changed to add `llvm::` so remove that too.
2022-08-05 21:25:55 -07:00
Pavel Yaskevich
f43aad2222
[BuilderTransform] Use correct locator for case subject expressions
...
Instead of `CTP_Initialization` transform should use `CTP_CaseStmt`
to identify the root correctly.
2022-08-03 15:50:33 -07:00
Meghana Gupta
d58560e65c
Fix source to use template <typename T, unsigned N> class SmallVector
...
The SmallVector version with default template does not compile with older compiler versions
2022-08-03 12:00:57 -07:00
Alex Hoppen
a368f024bb
[TypeChecker] Use the brace statement as the start location of a buildLimitedAvailability call
...
Otherwise, the call to buildLimitedAvailability has a bigger source range than the brace statement that surrounds it, causing a verification failure.
2022-08-02 11:59:03 -07:00
Pavel Yaskevich
186bf0ab3b
[BuilderTransform] Cache previously applied transforms
...
Since result builder is just an AST transformation, the result
of a successful transform could be cache and reused with a different
`$__builderSelf` type.
2022-08-02 11:59:03 -07:00
Pavel Yaskevich
04952fdc0a
[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.
2022-08-02 11:59:03 -07:00
Pavel Yaskevich
8850dcfea4
[BuilderTransform] Move some of the common logic into a base class
...
The base class is intended to facilitate logic sharing between
existing one-way constraint based transform and the new AST one.
2022-08-02 11:03:26 -07:00
Pavel Yaskevich
22daa865b5
[ConstraintSystem] Make for-in solution application target standalone
...
Previously for-in target was actually an expression target, which means
certain type-checking behavior. These changes make it a standalone target
with custom behavior which would allow solver to introduce implicit
`makeIterator` and `next` calls and move some logic from SILGen.
2022-05-30 23:17:41 -07:00
Pavel Yaskevich
9773a3c1d5
Merge pull request #42395 from xedin/result-builder-type
...
[BuilderTransform] Extract all builder related operations into `ResultBuilder` type
2022-04-25 10:25:15 -07:00
Josh Soref
4c77c59269
Spelling sema ( #42474 )
...
* spelling: accessibility
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: accessories
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: adjustments
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: all
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: ambiguous
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: arguments
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: assignment
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: associated
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: assumes
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: auxiliary
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: availability
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: available
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: belongs
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: checking
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: clazz
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: compatibility
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: completely
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: completion
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: complicated
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: conformance
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: constrained
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: constraint
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: contextual
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: conversion
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: convertible
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: couldn't
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: declaration
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: defaultable
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: dependent
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: depending
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: describe
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: diagnostic
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: diagnostics
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: existential
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: expects
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: explicit
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: explicitly
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: expression
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: first
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: font
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: forward
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: generation
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: generic
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: given
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: global
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: guarantee
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: happened
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: hierarchy
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: identical
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: immediately
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: implicit
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: indicates
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: inferred
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: initialization
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: initialize
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: initializer
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: integrity
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: interpolation
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: introducing
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: involved
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: just
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: like
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: likewise
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: mismatch
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: missing
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: more
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: necessarily
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: noescape
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: nonetheless
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: occurrences
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: operators
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: optional
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: otherwise
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: outside
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: overload
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: overridden
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: override
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: parameter
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: parameters
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: penalize
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: platforms
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: precedence
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: preemptively
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: preliminary
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: preserve
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: propagate
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: propagated
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: qualifier
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: question
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: really
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: received
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: references
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: replaceable
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: replacement
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: representable
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: representative
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: requirement
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: requires
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: resolved
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: retrieve
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: rewriting
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: satisfied
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: semantics
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: signature
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: similar
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: simplest
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: simplification
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: solver
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: struct
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: structurally
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: success
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: sure
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: symmetric
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: syntactically
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: target
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: that
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: the
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: themselves
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: these
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: this
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: transform
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: transparent
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: tread
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: truncation
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: type
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: unconstructable
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: universally
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: unknown
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: unwrapped
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: versioned
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: visible
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
* spelling: where
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com >
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com >
2022-04-20 15:12:46 -07:00
Pavel Yaskevich
6bc6ded6cf
[BuilderTransform] Move buildVarRef to ResultBuilder type
2022-04-15 14:26:55 -07:00
Pavel Yaskevich
f54172e222
[BuilderTransform] Handle ReturnStmt via CONTROL_FLOW_STMT macro
2022-04-15 14:26:55 -07:00
Pavel Yaskevich
54d6bc9bc3
[BuilderTransform] Move buildVar to ResultBuilder type
2022-04-15 14:26:55 -07:00
Pavel Yaskevich
e087489f30
[BuilderTransform] Move buildCall to ResultBuilder type
2022-04-15 14:26:44 -07:00
Pavel Yaskevich
95d9362506
[BuilderTransform] Extract support checks and builder info into ResultBuilder type
2022-04-15 14:26:36 -07:00
Pavel Yaskevich
018cd080c7
Merge pull request #42329 from xedin/builder-var
...
[BuilderTransform] Replace use of `TypeExpr` with a special $builderSelf variable
2022-04-15 09:36:05 -07:00
Pavel Yaskevich
fb4720d355
[BuilderTransform] Replace use of TypeExpr with a special $builderSelf variable
...
For all of the `build*` calls, let's use a special variable declaration
`$builderSelf` which refers to a type of the builder used. This allows
us to remove hacks related to use of `TypeExpr`. Reference to `$builderSelf`
is replaced with `TypeExpr` during solution application when the builder
type is completely resolved.
2022-04-14 21:16:48 -07:00
Alex Hoppen
b034c48b1d
[CodeCompletion] Record fixes while solving result builders for code completion
...
We record fixes while solving normal expressions for code completion and we should do the same when solving result builders if we are reporting the solutions to completion callbacks.
2022-04-08 11:16:08 +02:00
swift-ci
882edde92f
Merge pull request #41966 from rxwei/se-0348-if-approved
...
[ResultBuilders] Enable SE-0348 `buildPartialBlock` by default.
2022-04-04 21:21:19 -07:00
Doug Gregor
4db1f7d4e7
Map case variable types out of context.
...
Otherwise, we end up recording contextual types here.
2022-03-28 11:06:50 -07:00
Richard Wei
335b766b25
[ResultBuilders] Enable SE-0348 buildPartialBlock by default.
...
Enables SE-0348 `buildPartialBlock` feature by default. The frontend flag is kept for compatibility with existing clients, but is now ineffective.
Also includes some improved error messages for invalid result builder call sites.
2022-03-22 16:26:50 -07:00
Alex Hoppen
a8cec01c6f
[CodeCompletion] Exit early in applyResultBuilderBodyTransform after reporing solutions to code completion
2022-03-18 08:11:34 +01:00