Commit Graph

21 Commits

Author SHA1 Message Date
Pavel Yaskevich
2e1fe444a6 [Concurrency] Global actor isolated conformances are only allowed to override nonisolated.
Follow-up for https://github.com/swiftlang/swift/pull/79893.

More than one global actor isolated conformance at any level
creates a clash and conforming type should be inferred as `nonisolated`.

Resolves: rdar://154202375
2025-06-24 12:46:41 -07:00
Michael Gottesman
857ed26104 Merge pull request #82311 from gottesmm/pr-29a7ec5f7fd1b97205b69527c465cac0e3b4128a
Revert "[flow-isolation] Allow for initialization of fields of a Global Actor isolated class in its nonisolated inits"
2025-06-19 17:35:44 -07:00
Pavel Yaskevich
84cb3c89ff Merge pull request #79893 from simanerush/fix-explicit-nonisolated-proto-inference
[Concurrency] Look for explicit 'nonisolated' when getting isolation from protocol conformances.
2025-06-17 15:23:26 -07:00
Michael Gottesman
bf78c6206b Revert "[flow-isolation] Allow for initialization of fields of a Global Actor isolated class in its nonisolated inits"
This reverts commit 501bad55a8.
2025-06-17 13:01:28 -07:00
Pavel Yaskevich
06be7bda39 [Concurrency] SE-0449: Implied conformances to nonisolated protocols make witnesses nonisolated
Even if the requirement is stated on an isolated protocol if the
conformance is implied by a nonisolated one all of the requirements
and witnesses should be nonisolated.
2025-06-17 00:05:16 -07:00
Pavel Yaskevich
e50acbf3d5 [Concurrency] SE-0449: nonisolated on a type should prevent isolation inference from protocol requirements
If a `nonisolated` type conforms to a global-isolated protocol
the witnesses to the protocol requirements should infer the
isolation from the protocol but instead be `nonisolated`.

Resolves: rdar://145519840
2025-06-16 21:28:41 -07:00
Pavel Yaskevich
82497af27d [Tests] NFC: Add a test-case for main-actor isolated struct and nonisolated protocol 2025-06-16 15:58:25 -07:00
Sima Nerush
7e42a19187 [Concurrency] Make sure to still infer global actor if the conformance kind is explicit. 2025-06-16 13:59:15 -07:00
Sima Nerush
4fca62a771 [Concurrency] Look for explicit 'nonisolated' when getting isolation from protocol conformances. 2025-06-16 13:59:15 -07:00
Michael Gottesman
501bad55a8 [flow-isolation] Allow for initialization of fields of a Global Actor isolated class in its nonisolated inits
This just involved loosening some checks in the type checker so we stopped
erroring in the type checker and instead deferred to SIL level checks.

rdar://131136194
2025-06-02 08:37:05 -07:00
Anthony Latsis
72c0d4cc75 Diag: Handle CustomAttr in formatDiagnosticArgument 2025-03-28 02:03:38 +00:00
Hamish Knight
42e554ef7d [Parse] Set AttrRange for @nonisolated
Make sure we set the `AttrRange` in cases where `@` is present, but
`unsafe` isn't present.

rdar://147965036
2025-03-27 18:48:55 +00:00
Holly Borla
796dc9218b [Concurrency] Never treat nonisolated(unsafe) properties as actor
isolated.
2025-03-26 19:31:01 -07:00
Michael Gottesman
527616d105 [sema] Move some extra type checking from getIsolationFromAttribute to the attribute checker.
This never belonged in ActorIsolationRequest since it fits perfectly in the
attribute checker. This also simplifies the logic before I add code to
getIsolationFromAttribute to handle ExecutionAttribute.
2025-01-28 12:39:05 -08:00
Daniel Rodríguez Troitiño
5abb1ea6ac [test] Remove some REQUIRES: for features not longer used in those files
While doing #76740 I iteratively was adding new `REQUIRES:` as new
usages of the features were found, but I did not realize that at the
same time other people might be removing some of those usages. The tests
in this commit had some `REQUIRES:` line for a previous
`-enable-experimental/upcoming-feature`, but they not longer use those
features, so the `REQUIRES:` were effectively disabling the tests (at
least in the case of `KeyPathWithStaticMembers`. In other cases they
might still had executed).
2024-11-04 20:53:07 -08:00
Daniel Rodríguez Troitiño
ba68faaed5 [test] Mark tests that use experimental/upcoming features as such
Find all the usages of `--enable-experimental-feature` or
`--enable-upcoming-feature` in the tests and replace some of the
`REQUIRES: asserts` to use `REQUIRES: swift-feature-Foo` instead, which
should correctly apply to depending on the asserts/noasserts mode of the
toolchain for each feature.

Remove some comments that talked about enabling asserts since they don't
apply anymore (but I might had miss some).

All this was done with an automated script, so some formatting weirdness
might happen, but I hope I fixed most of those.

There might be some tests that were `REQUIRES: asserts` that might run
in `noasserts` toolchains now. This will normally be because their
feature went from experimental to upcoming/base and the tests were not
updated.
2024-11-02 11:46:46 -07:00
Sima Nerush
549262a57d [SE-0449] Promote GlobalActorInferenceCutoff to upcoming feature. 2024-10-22 15:25:58 -07:00
Allan Shortlidge
c02fc4724d Tests: Remove -disable-availability-checking from many Concurrency tests.
Instead, use the `%target-swift-5.1-abi-triple` substitution to compile the tests
for deployment to the minimum OS versions required for use of _Concurrency APIs.
2024-10-18 16:21:51 -07:00
Sima Nerush
7e5a57a07a Guard the changes behind an experimental feature flag. 2024-09-19 10:09:56 -07:00
Sima Nerush
6ff022d132 [Concurrency] Allow nonisolated on stored properties of non-'Sendable' type. 2024-09-19 10:09:11 -07:00
Sima Nerush
40185cce2a [Concurrency] Allow nonisolated to be used on protocols, extensions, classes, structs, and enums. 2024-09-19 10:09:11 -07:00