Skip to content

Commit 2d07bd5

Browse files
committed
Add @sharable annotation to global counter
1 parent 29f34de commit 2d07bd5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/cc/CaptureRoot.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ import printing.Showable
99
import util.SimpleIdentitySet
1010
import Decorators.i
1111
import scala.annotation.constructorOnly
12+
import scala.annotation.internal.sharable
1213

1314
type CaptureRoot = TermRef | CaptureRoot.Var
1415

1516
object CaptureRoot:
1617

17-
private var nextId = 0
18+
@sharable private var nextId = 0
1819

1920
case class Var(owner: Symbol, source: Symbol)(using @constructorOnly ictx: Context) extends CaptureRef, Showable:
2021

0 commit comments

Comments
 (0)