Commit Graph

20 Commits

Author SHA1 Message Date
Michael Gottesman
0d519a1acb [sema] Change non-sendable -> non-Sendable in diagnostics.
This matches send non sendable but importantly also makes it clear that we are
talking about something that doesn't conform to the Sendable protocol which is
capitalized.

rdar://151802975
(cherry picked from commit 3ed4059a60)
2025-05-23 10:31:05 -07:00
Adam Cmiel
939aaa94bd [Sema] Permit dot reference with isolation change without call
A dot-reference of a method defined on `Self` (as well as through `self`)
should be permitted to be made in a different actor isolation than
the referenced function's actor isolation if a call is not yet made, as
the DeclRefExpr can store the isolation of the referenced decl. That said,
we currently can only express that known isolation with global actor
annotations until the language adopts closure isolation control.

This is fixed on main so just recomming for the tests
2025-03-27 08:57:04 -04: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
Holly Borla
933f8eb8a0 [Concurrency] Split up the non-Sendable argument diagnostics and improve
wording.

Splitting up the diagnostic into separate diagnostics based on the reference
kind is easier for me to read. The wording of the error message now puts
the problem -- crossing an isolation boundary -- at the center of the message,
and attempts to clarify how the value crosses an isolation boundary. E.g. for
the witness diagnostics, the value crosses an isolation boundary when calling
the witness through the protocol requirement in generic code.

This change does not add any additional information to the diagnostics, but it'd
be valuable to show both the source and destination isolation.
2024-08-05 08:23:30 -07:00
Michael Gottesman
474aa47732 [concurrency] Standardize sending of non-isolated -> nonisolated to match the keyword 'nonisolated'.
rdar://130827967
2024-06-29 18:09:38 -07:00
Michael Gottesman
de85b79423 [concurrency] Make GlobalActorIsolatedTypesUsability an upcoming swift 6 feature.
rdar://118244451
2024-05-13 18:40:58 -07:00
Sima Nerush
05859b442c [Features] Gate global-actor-isolated types usability changes behind an experimental feature flag. 2024-03-23 20:03:01 -07:00
Sima Nerush
043cc26661 [Concurrency] Infer nonisolated for a mutable storage of a value type accessed from within the module. 2024-03-23 20:01:45 -07:00
Holly Borla
8bfe832c47 [Concurrency] Allow struct members to have isolation annotations. 2024-03-09 14:15:04 -08:00
Holly Borla
f1cd9cb422 [Test] Remove REQUIRES: asserts from tests that use -swift-version 6. 2024-02-13 07:13:35 -08:00
Holly Borla
09432a9993 [Concurrency] Sendable diagnostics are errors in Swift 6. 2024-01-30 18:50:00 -08:00
Pavel Yaskevich
dbf1146963 [Concurrency] NFC: Switch tests to use -strict-concurrency=complete instead of -warn-concurrency 2023-12-08 14:10:51 -08:00
Holly Borla
ab497d95cf [Concurrency] Downgrade the error for accessing isolated static lets across
actors to a warning.
2023-11-13 19:05:41 -05:00
Michael Gottesman
cb46851194 [region-isolation] Rename the experimental feature to RegionBasedIsolation.
This ensures that the pass is called TransferNonSendable but the experimental
feature is RegionBasedIsolation.
2023-10-26 12:01:44 -07:00
Michael Gottesman
0bad8f9b67 [region-isolation] Rename SendNonSendable.cpp -> TransferNonSendable.cpp. 2023-10-26 12:01:44 -07:00
Michael Gottesman
026f1735b5 [send-non-sendable] Update concurrency tests so that we run them in all concurrency modes as appropriate.
This means that:

1. In test cases where minimal is the default (swift 5 without
-warn-concurrency), I added RUN lines for targeted, complete, and complete +
sns.

2. In test cases where complete is the default (swift 6, -warn-concurrency,
specified complete with -strict-concurrency), I added a send non-sendable run
line.

In each of these cases, I added additional expected-* lines as appropriate so
the tests can compile in each mode successfully.
2023-08-30 13:40:17 -07:00
Holly Borla
84eaeb766f [Concurrency] Diagnose non-Sendable 'self' arguments crossing actor isolation
boundaries in member reference expressions.
2023-08-22 21:28:33 -07:00
Angela Laar
b9c5ebe3b5 Fix tests 2022-08-08 15:58:01 -07:00
Rintaro Ishizaki
20750b7d42 [Tests] Add REQUIRES: asserts to -swift-version 6 tests 2022-02-07 09:38:03 -08:00
Kavon Farvardin
13dd3d9ecf have the inferred isolation for properties change only in Swift 6
This patch delays the removal of redundant isolation for inferred
global-actor isolation to Swift 6 too, since we only warn about it
changing in Swift 5. Otherwise, only isolation that is a byproduct
of inference no longer needs an await, which will probably confuse
people.

This change is with respect to SE-327, which argues that the
non-static stored properties of ordinary structs do not need
global-actor isolation.
2022-02-04 14:43:12 -07:00