Commit Graph

13 Commits

Author SHA1 Message Date
Pavel Yaskevich
9e562881fe [TypeChecker] Improve diagnostics for access to actor-isolated values outside of the actor
Replaces generic `expression is 'async' but is not marked with 'await`
diagnostic with a tailed one for cases where there is an access to an
actor-isolated value outside of its actor without `await` keyword.

This makes the diagnostics for async and sync contexts consistent
and actually identifies a problem instead of simply pointing out
the solution.

Resolves: rdar://151720646
2025-05-23 00:20:18 -07:00
Michael Gottesman
3ed4059a60 [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
2025-05-22 11:37:58 -07:00
Holly Borla
7dbec846f7 [NFC] Update a few tests for concurrency diagnostics changes. 2024-08-05 17:26:07 -07:00
Holly Borla
1b0dca035e [NFC] Update concurrency validation test. 2024-05-16 10:18:34 -07:00
Holly Borla
2a18edc178 [NFC][Concurrency] Update validation tests for @MainActor(unsafe) changes. 2024-01-22 08:43:27 -08:00
Holly Borla
79593411d9 [Concurrency] Set preconcurrency for actor isolation created from unsafe global
actor attributes.
2024-01-19 09:29:13 -08: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
Holly Borla
0708e0efd4 Revert "Tests: Disable failing SwiftUI validation tests" 2022-11-15 09:10:23 -08:00
Allan Shortlidge
b2421aa463 Tests: Disable failing SwiftUI validation tests until rdar://102298208 is fixed. 2022-11-13 16:56:20 -08:00
Doug Gregor
4116d7a3d7 Rename the -strict-concurrency= options to be more descriptive.
The three options are now:

* `explicit`: Enforce Sendable constraints where it has been explicitly adopted and perform actor-isolation checking wherever code has adopted concurrency. (This is the default)
* `targeted`: Enforce Sendable constraints and perform actor-isolation checking wherever code has adopted concurrency, including code that has explicitly adopted Sendable.
* `complete`: Enforce Sendable constraints and actor-isolation checking throughout the entire module.
2022-04-20 18:17:33 -07:00
Doug Gregor
3f4bc7df37 Add -strict-concurrency=limited to one more test. 2022-04-20 09:11:10 -07: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
Kavon Farvardin
19bdfb1172 In a property-wrapper, global-actor isolation remains on wrappedValue
If a struct is a property-wrapper, then global-actor isolation
still applies to the `wrappedValue`, even if it's a stored property.
This is needed in order to support the propagation of global-actor
isolation through the wrapper, even when the programmer has opted
to use a stored property instead of a computed one for the
`wrappedValue`. Since this propagation is a useful pattern, I think
this exception is reasonable.
2022-02-04 14:41:49 -07:00