@@ -1314,19 +1314,20 @@ this attribute reduces the strictness of concurrency checking
1314
1314
for code that uses types from the imported module.
1315
1315
Specifically,
1316
1316
types from the imported module
1317
- that aren't explicitly marked as either sendable or nonsendable
1317
+ that aren't explicitly marked as nonsendable
1318
1318
can be used in a context that requires sendable types.
1319
1319
1320
1320
On other declarations,
1321
1321
this attribute reduces the strictness of concurrency checking
1322
1322
for code that uses the symbol being declared.
1323
1323
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 .
1327
1327
You can apply this attribute
1328
1328
to the following kinds of declarations:
1329
1329
1330
+ - Imports
1330
1331
- Structures, classes, and actors
1331
1332
- Enumerations and enumeration cases
1332
1333
- Protocols
@@ -1339,15 +1340,21 @@ You can use this attribute as follows,
1339
1340
to aid in migrating code to strict concurrency checking:
1340
1341
1341
1342
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
1348
1348
any places where the ` preconcurrency ` attribute on an import
1349
1349
no longer has an effect and should be removed.
1350
1350
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
+
1351
1358
Declarations from Objective-C are always imported
1352
1359
as if they were marked with the ` preconcurrency ` attribute.
1353
1360
0 commit comments