Commit Graph

2056 Commits

Author SHA1 Message Date
Pavel Yaskevich
14dab87684 [ConstraintSystem] Discount effects while filtering call overload sets
Before these changes filtering would not favor some members because their
function types have `escaping` bit set when argument function type never
has it.

Double/CGFloat implicit conversion is one of such cases where `CGFloat.init`
overloads have `escaping` bit, which leads to solver checking more overloads
then it should.

Note that the difference in effects such as `async` is going to be handled
by scoring and ranking after partial solution is produced, so overloads that
differ only in `async` or `throws` are still going to be solved for as part
of "favored" set.
2022-06-28 13:07:23 -07:00
Holly Borla
429488f6c9 [Sema] Use ExistentialType for Any and AnyObject. 2022-06-17 18:29:15 -07:00
Pavel Yaskevich
7ba07ae3ba Merge pull request #59210 from xedin/conflicting-patterns-in-case
[Diagnostics] Diagnose conflicting pattern variables
2022-06-14 11:30:34 -07:00
Luciano Almeida
c9f10040f7 Merge pull request #59277 from LucianoPAlmeida/dictionary-array-literals
[Sema] Allow TreatArrayLiteralAsDictionary fix to handle literals with more than one element
2022-06-07 09:39:45 -03:00
Luciano Almeida
42cf1b73de [Sema] Adjusting repairArraLiteralUsedAsDictionary to also ignore OptToOpt promotions 2022-06-07 01:18:35 -03:00
Luciano Almeida
c6f00fae98 [Sema] Allow TreatArrayLiteralAsDictionary fix to handle literals with more than one element 2022-06-05 22:36:35 -03:00
Pavel Yaskevich
f15a0b16cb [CSFix] Detect conflicting pattern variables
The fix indentifies the conflicting variables and the expected
"join" type e.g. `case .a(let x), .b(let x)` where `a(Int)` and
`b(String)`.
2022-06-03 16:31:27 -07:00
Pavel Yaskevich
644a720ce6 Merge pull request #59003 from xedin/rdar-92177656
[TypeChecker] Rework type-checking of `for-in` statements
2022-06-02 14:58:56 -07:00
Pavel Yaskevich
27419446b6 Merge pull request #59064 from xedin/issue-59058
[CSSimplify] If function types mismatch on labels record a contextual…
2022-06-02 10:18:54 -07:00
Pavel Yaskevich
ef0523fe29 [ConstraintSystem] NFC: Remove obsolete ValueWitness constraint 2022-05-30 23:17:41 -07:00
Pavel Yaskevich
5f0dcb572b [ConstraintSystem] Implicitly open existential type of for-in sequence
This allows to use `for-in` statement to iterate over i.e. `any Collection`
and other existentials that conform to `Sequence` protocol.
2022-05-30 23:17:41 -07:00
Pavel Yaskevich
e9b06471a9 [CSSimplify] Don't record requirement failure if one of the sides is unresolved 2022-05-30 23:17:41 -07:00
Pavel Yaskevich
0989cd9a06 [CSSimplify] Ignore missing next member on $generator
The actual issue in this cases is that the type of a sequence
doesn't conform to `Sequence` protocol, which means that it's
impossible to deduce a base for `next` call.
2022-05-30 23:17:41 -07:00
Pavel Yaskevich
86165291aa [TypeChecker] Change the way for-in statement in type-checked
Instead of asking SILGen to build calls to `makeIterator` and
`$generator.next()`, let's synthesize and type-check them
together with the rest of for-in preamble. This greatly simplifies
interaction between Sema and SILGen for for-in statements.
2022-05-30 23:17:41 -07:00
Pavel Yaskevich
1be0eafb2c [CSSimplify] Ignore missing makeIterator member
The actual issue in this cases is that the type of a sequence
doesn't conform to `Sequence` protocol.
2022-05-30 23:17:41 -07:00
Doug Gregor
72c92892fd Introduce feature ForwardTrailingClosures for SE-0286.
Replace the "Swift version 6" checks for forward-scanning trailing
closure matching with checks for this new feature.
2022-05-30 08:32:56 -07:00
Doug Gregor
93fef0591b Merge pull request #59113 from DougGregor/enable-experimental-feature
Add -enable-experimental-feature X for experimental features.
2022-05-27 15:07:31 -07:00
Doug Gregor
333ae3f830 Add experimental feature for one-way closure parameters 2022-05-27 11:52:29 -07:00
Pavel Yaskevich
689e9e3861 Merge pull request #42559 from xedin/se-0352-as-any-coercion
[TypeChecker] SE-0352: Require coercion if result type contains existential(s) that would loose generic requirements
2022-05-27 09:44:31 -07:00
Pavel Yaskevich
8eba8907a2 [CSSimplify] Don't suppress existential opening if as any ... is in parens 2022-05-26 15:34:40 -07:00
Doug Gregor
6d82448dc8 Add -enable-experimental-feature X for experimental features.
Experimental features can only be enabled in non-production (+Asserts)
builds. They can be detected with `hasFeature` in the same manner as
"future" features.

The `-enable-experimental-feature X` flag will also look for future
features by that name, so that when an experimental feature becomes an
accepted future feature, it will still be enabled in the same manner.

Switch variadic generics over to this approach, eliminating the
specific LangOption for it.
2022-05-26 11:50:39 -07:00
Robert Widmann
c9ddfbc800 Merge pull request #59090 from CodaFi/unknown-unknowns
Handle ParamDecls and VarDecls in Argument Matching Diagnostics
2022-05-26 10:34:34 -07:00
Pavel Yaskevich
7d8af2d03a Merge pull request #58953 from xedin/fix-callAsFunction-perf
[CSSimplify] Disfavor choices that have injected `callAsFunction`
2022-05-26 09:51:33 -07:00
Pavel Yaskevich
7898b5a088 [CSSimplify] Disfavor choices that have injected callAsFunction
Ambiguities like:

```
struct S {
  init(v: Int) {}
  init(v: Int, _: () -> Void) {}

  func callAsFunction(_: () -> Void) {}
}

S(v: 42) {
}
```

Should always be resolved in favor of choice that doesn't require
injection of `.callAsFunction`, so let's try to avoid solving if
such an overload has already been found.
2022-05-26 00:47:34 -07:00
Pavel Yaskevich
0a5b3f0727 [TypeChecker] SE-0324: Extend Swift -> C pointer conversions to inout
Fixes an oversight where `inout` -> C pointer conversion wasn't covered
by implementation of new pointer conversion semantics proposed by SE-0324.

Resolves: rdar://92583588
2022-05-25 20:55:22 -07:00
Robert Widmann
174bbd2586 Handle ParamDecls and VarDecls in Argument Matching Diagnostics
These don't produce meaningful ParameterLists for this analysis to
consider. Bail instead of crashing.

rdar://93922410
2022-05-25 16:12:03 -07:00
Pavel Yaskevich
f08eec4a17 [CSSimplify] Start checking whether result type of a call needs a coercion
If there is going to be any loss of generic requirements in the result,
a result of a call has to use explicit coercion.
2022-05-25 16:07:05 -07:00
Pavel Yaskevich
8306724d81 [CSFix] Add a skeleton fix to require explicit existential coercion 2022-05-25 16:07:05 -07:00
Pavel Yaskevich
8fd8408075 [CSSimplify] If function types mismatch on labels record a contextual mismatch
`RelabelArguments` cannot possibly diagnose this issue because there
are no argument lists in this case. Let's report contextual mismatch
instead.

Resolves: https://github.com/apple/swift/issues/59058
2022-05-24 16:58:43 -07:00
Pavel Yaskevich
d81007cf08 [CSSimplify] Avoid filtering init overloads of a callable type
If there is a call to `init` on a callable type that has a trailing
closure, let's avoid filtering because it's impossible to tell whether
a trailing closure belongs to an `init` call or implicit `.callAsFunction`
that would be attempted after it.

Resolves: rdar://92912878
2022-05-09 18:12:52 -07:00
Pavel Yaskevich
8508e187c1 Merge pull request #58531 from xedin/rdar-92327807
[CSSimplify] Don't attempt to synthesize ~= for optional base types
2022-05-04 10:55:56 -07:00
Robert Widmann
4f8678563c Merge pull request #58624 from CodaFi/existence-is-suffering
Existential Types Cannot Satisfy Superclass Bounds
2022-05-03 08:57:29 -07:00
Robert Widmann
6d28831617 Existential Types Cannot Satisfy Superclass Bounds
It is not the case that `any P` satisfies a class bound
even if the existential is a composition with an exact
match to the class bound. The resulting existential box
must be opened as the exact class type before this conversion
can succeed.

This appears to be a regression from Swift 5.1, which was the last
Swift compiler that banned this typing rule.

rdar://92358570
2022-05-02 15:59:10 -07:00
Pavel Yaskevich
2c140bdf4d Merge pull request #58503 from xedin/rdar-92366212
[ConstraintSystem] Fail `~=` synthesis if constraint generation fails
2022-04-29 10:19:01 -07:00
Pavel Yaskevich
f0ba1a859a [CSSimplify] Don't attempt to synthesize ~= for optional base types
`EnumElement` patterns with optional base type do member lookup
on both optional type and its wrapped type but do not synthesize
`~=` operator call.

Resolves: rdar://92327807
2022-04-29 10:09:31 -07:00
Pavel Yaskevich
48e70ed6cc [ConstraintSystem] Fail ~= synthesis if constraint generation fails
If constraint generation for application of `~=` failed that should
result in an immediate synthesis failure.

Resolves: rdar://92366212
2022-04-28 18:02:19 -07:00
Pavel Yaskevich
0e4d16d585 [ConstraintSystem] Fail closure resolution if one of the parameters has invalid property wrapper 2022-04-28 18:02:19 -07:00
Doug Gregor
e7a559f2f4 Merge pull request #58427 from DougGregor/downgrade-sendable-function-conversions 2022-04-26 21:13:41 -07:00
Doug Gregor
1c55138dcf Downgrade missing @Sendable to a warning in Swift 5.x mode.
We're treating Sendable issues as warnings, not errors, so downgrade
function conversion errors to warnings as well. Fixes rdar://92291276.
2022-04-26 15:48:54 -07:00
Pavel Yaskevich
6a65810d30 [Constraint] NFC: Rename ClosureBodyElement to SyntacticElement
`SyntacticElement` represents a statement, pattern, declaration,
condition, or expression and could originate from i.e. a closure,
a function or a result builder body.
2022-04-26 09:55:04 -07:00
Doug Gregor
0e98bf28f0 Introduce missing Sendable conformances for existential conversions
When performing conversions to an existential that involves Sendable,
introducing missing conformances as needed to allow the type-check to
succeed and then (later) they'll be diagnosed appropriately.

Fixes rdar://89992095.
2022-04-22 23:56:58 -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
Luciano Almeida
a6ab3b613e [Sema] Refactor TypeChecker::typeCheckCheckedCast in order to remove all diagnostic emiting logic from it 2022-04-14 00:12:33 -03:00
John McCall
d079679e0c Merge pull request #42317 from rjmccall/build-constrained-existential-metadata
IR generation for constrained existentials
2022-04-12 19:37:53 -04:00
John McCall
5519749ade [NFC] Collect protocol decls, not type, in ExistentialLayout
Another thing that will be necessary for correctness with
compositions of parameterized protocols.
2022-04-11 22:15:16 -04:00
Pavel Yaskevich
27fb7885aa [CSSimplify] NFC: Remove unused ASTContext reference left after SE-0347 flag 2022-04-11 15:17:15 -07:00
Pavel Yaskevich
b03021dbb7 [TypeChecker] SE-0347: Enable type inference from default expressions 2022-04-06 15:03:00 -07:00
Pavel Yaskevich
d727a79963 Merge pull request #42146 from xedin/rdar-91145060
[ConstraintSystem] Cache types of `~=` components
2022-04-04 10:35:52 -07:00
Alex Hoppen
0ded798ceb Merge pull request #42006 from ahoppen/pr/prepare-for-migrate-postfixexprparen
[CodeCompletion][Sema] Multiple improvements to prepare for migration of PostfixExprParen to solver-based
2022-04-03 16:43:36 +02:00
Pavel Yaskevich
8b8ccb488a [ConstraintSystem] Cache types of ~= components
While synthesizing `~=` application for multi-statement closures or
result builder, solver shouldn't set types directly to newly
created AST nodes because they might not be fully resolved, instead
such types have to be recorded in the constraint system and then
set during solution application.

Resolves: rdar://91145060.
2022-04-01 14:00:43 -07:00