File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -590,6 +590,18 @@ dynamic replacement of functions with an opaque return type.
590
590
591
591
## ` @_weakLinked `
592
592
593
+ Allows a declaration to be weakly-referenced, i.e., any references emitted by
594
+ client modules to the declaration's symbol will have weak linkage. This means
595
+ that client code will compile without the guarantee that the symbol will be
596
+ available at runtime. This requires a dynamic safety check (such as using
597
+ ` dlsym (3) ` ); otherwise, accessing the symbol when it is unavailable leads
598
+ to a runtime crash.
599
+
600
+ This is an unsafe alternative to using ` @available ` , which is statically checked.
601
+ If the availability of a library symbol is newer than the deployment target of
602
+ the client, the symbol will be weakly linked, but checking for ` @available ` and
603
+ ` #(un)available ` ensures that a symbol is not accessed when it is unavailable.
604
+
593
605
## ` @_unsafeMainActor ` , ` @_unsafeSendable `
594
606
595
607
Marks a parameter's (function) type as ` @MainActor ` (` @Sendable ` ) in Swift 6 and
You can’t perform that action at this time.
0 commit comments