Commit Graph

10 Commits

Author SHA1 Message Date
Pavel Yaskevich
c4ea02c2d7 [BuilderTransform] Rework missing buildWithAvailability detection
Since all of the branches of an `if` statement are joined together
and hence produce the same type, that type should be used to
check whether `buildWithAvailability` is required but missing
regardless of availability condition kind.

Resolves: https://github.com/apple/swift/issues/63764
2023-02-18 01:04:15 -08: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
Allan Shortlidge
fbfb4d5227 Sema: Check the availability of result builder attributes on function parameters.
Resolves https://github.com/apple/swift/issues/60391 and rdar://99006375
2022-08-23 13:41:09 -07:00
Holly Borla
6e8a581b42 [LangOptions] Remove the option to enable/disable implicit existential
opening.
2022-06-27 18:03:20 -07:00
Doug Gregor
33be0beb12 Ensure that we only open existential arguments to functions/subscripts. 2022-02-18 11:22:57 -08:00
Bruno Rocha
adfb983e2b [SE-0290] Cleanup BuilderTransform for #unavailable 2021-07-02 13:35:12 +02:00
Bruno Rocha
1fe3857735 [SE-0290] Add #unavailable 2021-07-02 13:35:11 +02:00
Mishal Shah
22f61df98b Use %target-cpu in the tests to support running on Apple Silicon hardware 2021-04-08 23:26:18 -07:00
Slava Pestov
ae5bca927a Sema: Check result builder availability 2020-10-29 14:00:04 -04:00
Doug Gregor
6d41524fe6 [SE-0289] Finish renaming source code, tests to "result builders" 2020-10-20 22:18:51 -07:00