Commit Graph

68 Commits

Author SHA1 Message Date
Pavel Yaskevich
36a50c7070 [ResultBuilder] Don't run syntactic diagnostics on transformed do statements
Visiting of transformed `do` shouldn't run syntatic diagnostics because
they are going to be performed by `visit` that called `visitDoStmt`.
2022-12-21 10:31:36 -08:00
swift-ci
717f08fe4f Merge remote-tracking branch 'origin/main' into rebranch 2022-12-19 16:34:10 -08:00
Pavel Yaskevich
6c02e51817 [CSSyntacticElement] Replace global flag check with info from the solver
`transformedBody` is available only if the flag is set, so there
is no reason to double-check it before application, the presence
of the transformed body is evidence enough.
2022-12-19 12:16:54 -08:00
swift-ci
6ec91d1911 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-02 07:15:28 -08:00
Hamish Knight
791e2cd7ff Requestify computation of break/continue targets
Introduce BreakTargetRequest and
ContinueTargetRequest that perform the ASTScope
lookup for the target of a break or continue.
2022-12-01 19:08:27 +00:00
Rintaro Ishizaki
d458c8b74a Merge remote-tracking branch 'origin/main' into rebranch
Conflicts:
	include/swift/Sema/ConstraintSystem.h
	include/swift/Syntax/AbsoluteRawSyntax.h
	include/swift/Syntax/Syntax.h
	include/swift/Syntax/SyntaxData.h
	lib/DependencyScan/ModuleDependencyCacheSerialization.cpp
	lib/Syntax/SyntaxFactory.cpp.gyb
	lib/Syntax/SyntaxNodes.cpp.gyb
	tools/SourceKit/lib/SwiftLang/SwiftEditor.cpp
	tools/swift-syntax-test/swift-syntax-test.cpp
2022-11-18 09:37:38 -08:00
Pavel Yaskevich
4e3a4ffbe9 Merge pull request #62120 from xedin/rdar-100753270
[CSSyntaxElement] Detect type variables in sequence expressions of `for-in` loops
2022-11-17 09:54:22 -08:00
Angela Laar
b6637e4586 [CSSyntacticElement] Only add constraints when brace statement represents the whole body 2022-11-16 22:39:41 -08:00
Angela Laar
45fb9899d6 [CSSyntacticElement] Only set default if generator has no errors 2022-11-15 23:38:01 -08:00
Angela Laar
5d93b99a91 [CSClosure] Move participatesInInference check to Constraint Generator 2022-11-15 17:28:43 -08:00
Angela Laar
8257cc1e10 [CSClosure] Generate constraints for empty closure body
We should do this in the ConstraintGenerator instead of in a ConstraintSystem method.
2022-11-15 16:14:38 -08:00
Angela Laar
b4549d63f0 [Constraint System] Refactor generateConstraints
We don't need a separate generateConstraints function for closures.
2022-11-15 16:13:58 -08:00
Pavel Yaskevich
cab0cb52ab [CSSyntaxElement] Detect type variables in sequence expressions of for-in loops
Invalid syntax could introduce type variables into sequence which
have to be brought into scope otherwise solver is going to crash.

Resolves: rdar://100753270
2022-11-15 11:56:36 -08:00
swift-ci
568db96259 Merge remote-tracking branch 'origin/main' into rebranch 2022-11-15 02:54:21 -08:00
Pavel Yaskevich
f5f94fd8ee [CSClosure] Introduce SyntacticElementContext
Replace `AnyFunctionRef` as "context" for syntactic element with
a custom `SyntacticElementContext` to support type-checking of
other constructs in the future.
2022-11-14 20:03:42 +00: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
Hamish Knight
0faa0b60d4 [CS] NFC: Remove unused method 2022-11-14 20:03:40 +00:00
Hamish Knight
fd9fa72f0f [CS] NFC: Rename CSClosure.cpp -> CSSyntacticElement.cpp
We want to generalize this conjunction logic to
not just be applicable to closures, so rename the
file to match.
2022-11-14 20:03:39 +00:00