Skip to content

Commit e76ab5d

Browse files
committed
Space: Make new mutation @sharable
1 parent 799de6c commit e76ab5d

File tree

1 file changed

+3
-2
lines changed
  • compiler/src/dotty/tools/dotc/transform/patmat

1 file changed

+3
-2
lines changed

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import reporting._
2323
import config.Printers.{exhaustivity => debug}
2424
import util.{SrcPos, NoSourcePosition}
2525

26+
import scala.annotation.internal.sharable
2627
import scala.collection.mutable
2728

2829
/* Space logic for checking exhaustivity and unreachability of pattern matching
@@ -58,7 +59,7 @@ import scala.collection.mutable
5859
sealed trait Space:
5960
import SpaceEngine.*
6061

61-
private val isSubspaceCache = mutable.HashMap.empty[Space, Boolean]
62+
@sharable private val isSubspaceCache = mutable.HashMap.empty[Space, Boolean]
6263

6364
def isSubspace(b: Space)(using Context): Boolean =
6465
val a = this
@@ -71,7 +72,7 @@ sealed trait Space:
7172
isSubspaceCache.getOrElseUpdate(b, computeIsSubspace(a, b))
7273
}
7374

74-
private var mySimplify: Space | Null = _
75+
@sharable private var mySimplify: Space | Null = _
7576

7677
def simplify(using Context): Space =
7778
val simplify = mySimplify

0 commit comments

Comments
 (0)