Skip to content

Commit

Permalink
Fix some typos in README (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jager-yoo authored Oct 24, 2023
1 parent cd99a26 commit c67f9f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2664,19 +2664,19 @@ _You can enable the following settings in Xcode by running [this script](resourc

```swift
// WRONG: Unsafely marking a non-thread-safe class as Sendable only to suppress errors
import PlantaryBody
import PlanetaryBody

extension PlanetaryBody: @unchecked Sendable { }

// RIGHT
@preconcurreny import PlanetaryBody
@preconcurrency import PlanetaryBody
```

### 3. Restructure code so the compiler can verify that it is thread-safe

If possible, restructure code so that the compiler can verify that it is thread safe. This lets you use a `Sendable` conformance instead of an unsafe `@unchecked Sendable` conformance.

When conforming to `Sendable`, the compiler will emit an error in the future if you attempt to make a change that is not thread-safe. This guaruntee is lost when using `@unchecked Sendable`, which makes it easier to accidentially introduce changes which are not thread-safe.
When conforming to `Sendable`, the compiler will emit an error in the future if you attempt to make a change that is not thread-safe. This guarantee is lost when using `@unchecked Sendable`, which makes it easier to accidentally introduce changes which are not thread-safe.

For example, given this set of classes:

Expand Down

0 comments on commit c67f9f4

Please sign in to comment.