Commit Graph

5 Commits

Author SHA1 Message Date
Pavel Yaskevich
d70f14e936 [BuilderTransform] If: Save result of buildBlock into a variable before using in buildEither
Similar to `case` statements, if chain is non-optional, let's
isolate `buildBlock` of every branch into a separate type variable.
2025-02-25 13:09:35 -08:00
Holly Borla
9ba481ad53 [Diagnostics] Clarify the wording of error_in_future_swift_version. 2024-03-01 12:05:51 -08:00
Slava Pestov
290701cb4d Sema: Ban shadowing generic parameters from outer scopes
Code like that is usually indicative of programmer error, and does not
round-trip through module interface files since there is no source
syntax to refer to an outer generic parameter.

For source compatibility this is a warning, but becomes an error with
-swift-version 6.

Fixes rdar://problem/108385980 and https://github.com/apple/swift/issues/62767.
2023-04-25 17:41:23 -04:00
Pavel Yaskevich
36c61bdd3e [Tests] NFC: Remove ResultBuilderASTTransform references from tests 2023-03-15 14:29:04 -07: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