Skip to content

Commit 4805de5

Browse files
Incorporate tech review
Co-authored-by: Doug Gregor <[email protected]>
1 parent b79a599 commit 4805de5

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

TSPL.docc/ReferenceManual/Attributes.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,19 +1314,20 @@ this attribute reduces the strictness of concurrency checking
13141314
for code that uses types from the imported module.
13151315
Specifically,
13161316
types from the imported module
1317-
that aren't explicitly marked as either sendable or nonsendable
1317+
that aren't explicitly marked as nonsendable
13181318
can be used in a context that requires sendable types.
13191319

13201320
On other declarations,
13211321
this attribute reduces the strictness of concurrency checking
13221322
for code that uses the symbol being declared.
13231323
When you use this symbol in a scope that has minimal concurrency checking,
1324-
you can use members of this type
1325-
that aren't explicitly marked as either sendable or nonsendable
1326-
in a context that requires sendable types.
1324+
concurrency-related constraints specified by that symbol,
1325+
such as `Sendable` requirements or global actors,
1326+
aren't checked.
13271327
You can apply this attribute
13281328
to the following kinds of declarations:
13291329

1330+
- Imports
13301331
- Structures, classes, and actors
13311332
- Enumerations and enumeration cases
13321333
- Protocols
@@ -1339,15 +1340,21 @@ You can use this attribute as follows,
13391340
to aid in migrating code to strict concurrency checking:
13401341

13411342
1. Enable strict checking.
1342-
1. Annotate imports and declarations that need to be migrated
1343-
with the `preconcurrency` attribute.
1344-
1. After migrating a declaration,
1345-
remove the `preconcurrency` attribute from it.
1346-
1. After migrating a module,
1347-
the compiler will warn you about
1343+
1. Annotate imports with the `preconcurrency` attribute
1344+
for modules that haven't enabled strict checking.
1345+
1. After migrating a module to strict checking,
1346+
remove the `preconcurrency` attribute.
1347+
The compiler warns you about
13481348
any places where the `preconcurrency` attribute on an import
13491349
no longer has an effect and should be removed.
13501350

1351+
For other declarations,
1352+
add the `preconcurrency` attribute
1353+
when you add concurrency-related constraints to the declaration,
1354+
if you still have clients
1355+
that haven't migrated to strict checking.
1356+
Remove the `preconcurrency` attribute after all your clients have migrated.
1357+
13511358
Declarations from Objective-C are always imported
13521359
as if they were marked with the `preconcurrency` attribute.
13531360

0 commit comments

Comments
 (0)