From 3787ae4e6519efd3a5f08f6efb819c4e74dc8034 Mon Sep 17 00:00:00 2001 From: Vamshi Maskuri <117595548+varshith257@users.noreply.github.com> Date: Fri, 29 Nov 2024 08:15:03 +0530 Subject: [PATCH] Update ref.md --- docs/reference/concurrency/ref.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/concurrency/ref.md b/docs/reference/concurrency/ref.md index 81f0319a75ff..c3b80e270e6a 100644 --- a/docs/reference/concurrency/ref.md +++ b/docs/reference/concurrency/ref.md @@ -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) ```