Commit Graph

11 Commits

Author SHA1 Message Date
Doug Gregor
1aaba1f285 Don't check sendability of witnesses for @preconcurrency conformances
When a witness is part of a `@preconcurrency` conformance, suppress
Sendable checking for that witness because we assume that the caller is
correctly invoking this witness from within the right isolation
domain. This property is dynamically checked.

Fixes https://github.com/apple/swift/issues/74057.
2024-06-05 22:44:44 -07:00
Doug Gregor
5a0e70a2bc Update diagnostic text to address code review feedback 2024-05-20 22:06:40 -07:00
Doug Gregor
640042f396 Suggest @preconcurrency on conformances it could help
When diagnosing a case where an actor-isolated witness cannot satisfy
a non-isolated requirement, also suggest that the conformance could be
annotated with `@preconcurrency`.
2024-05-20 22:06:40 -07:00
Doug Gregor
e9220b48d8 Add a Fix-It to the warning about unnecessary @preconcurrency conformance
When we diagnose an unnecessary `@preconcurrency` on a conformance,
also provide a Fix-It to remove the `@preconcurrency`.
2024-05-19 17:03:08 -07:00
Pavel Yaskevich
03e9d4258e [Frontend] NFC: Promote DynamicActorIsolation to an upcoming feature flag 2024-04-14 21:28:13 -07:00
Pavel Yaskevich
db7959668e [Frontend] NFC: Rename PreconcurrencyConformances to DynamicActorIsolation 2024-02-01 13:28:25 -08:00
Pavel Yaskevich
c3a0822260 [Tests] NFC: Disable availability checking in @preconcurrency conformances tests 2024-01-16 16:21:06 -08:00
Pavel Yaskevich
1caafee3cf [Sema] Diagnose places where @preconcurrency attribute on conformance has no effect 2024-01-16 11:51:49 -08:00
Pavel Yaskevich
13f83598ea [Sema] @preconcurrency conformances have no effect for protocols that adopted concurrency
Don't treat isolated or explicitly `nonisolated` requirements as
preconcurrency because in that case we consider protocol as
concurrency adopter.
2024-01-16 11:51:49 -08:00
Pavel Yaskevich
451308422b [Sema] Suppress actor isolation checking for @preconcurrency conformances
Suppress warnings/errors when actor isolated synchroneous witness
is matched against `@preconcurrency` conformance requirement.

Witness thunk assumes isolation of the witness but instead of a
hop to its executor it would emit a runtime check to make sure
that its always called from the expected context.
2024-01-16 11:51:49 -08:00
Pavel Yaskevich
4943e146bd [Frontend] Add experimental flag for @preconcurrency conformances feature 2024-01-16 10:31:01 -08:00