Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/reference/concurrency/ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ The following snippet compiles, but it leads to race conditions due to a mutable

```scala mdoc:nest
// Compiles but don't work properly
var init = 0
val init = collection.mutable.Seq(1,3,5)
val counterRef = Ref.make(init)
```

To correct this, we should change the `init` to be immutable:

```scala mdoc:nest
val init = 0
val init = Seq(1,3,5)
val counterRef = Ref.make(init)
```

Expand Down
Loading