Skip to content

Commit 8e906f2

Browse files
committed
Start sketching reference for @preconcurrency
1 parent c6a1813 commit 8e906f2

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

TSPL.docc/ReferenceManual/Attributes.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,54 @@ can increase your binary size and adversely affect performance.
13041304
because of the larger symbol table slowing dyld down.
13051305
-->
13061306

1307+
### preconcurrency
1308+
1309+
Apply this attribute to an import declaration or a declaration,
1310+
to suppress strict concurrency checking.
1311+
1312+
On an import declaration,
1313+
this attribute reduces the strictness of conccurrency checking
1314+
for code that uses types from the imported module.
1315+
Specifically,
1316+
types fromthe imported module
1317+
that aren't explicitly marked as either sendeble or nonsendable
1318+
can be used in a context that requires sendable types.
1319+
<!--XXX If the attribute isn't doing anything, it produces a warning.-->
1320+
1321+
You can apply this attribute
1322+
to the following kinds of declarations:
1323+
1324+
- Structures, classes, and actors
1325+
- Enumerations and enumeration cases
1326+
- Protocols
1327+
- Variables and constants
1328+
- Subscripts
1329+
- Initializers
1330+
- Functions
1331+
1332+
On a declaration,
1333+
this attribute indicates
1334+
1335+
<!-- XXX from SE-0337
1336+
Its name is mangled as though it does not use any of the listed features.
1337+
1338+
At use sites whose enclosing scope uses Minimal concurrency checking, the compiler will suppress any diagnostics about mismatches in these traits.
1339+
1340+
The ABI checker will remove any use of these features when it produces its digests.
1341+
-->
1342+
1343+
<!-- Probably move to some migration article/context:
1344+
1345+
You can use this attribute to aid in migration to strict concurrency checking:
1346+
1347+
1. Enable strict checking
1348+
1. Annotate imports with `@preconcurrency` as needed
1349+
1. After migrating the imported module, XXX
1350+
1. Remove `@preconcurrency` from import declarations
1351+
-->
1352+
1353+
Declarations from Objective-C are always imported
1354+
as if they were marked with the `preconcurrency` attribute.
13071355
### propertyWrapper
13081356

13091357
Apply this attribute to a class, structure, or enumeration declaration

0 commit comments

Comments
 (0)