Skip to content

Commit e6a9ffd

Browse files
committed
Avoid sharing a mutable empty GadtConstraint!
1 parent 4e8a1a6 commit e6a9ffd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/src/dotty/tools/dotc/core/GadtConstraint.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ import util.{SimpleIdentitySet, SimpleIdentityMap}
1010
import collection.mutable
1111
import printing._
1212

13-
import scala.annotation.internal.sharable
14-
1513
object GadtConstraint:
16-
@sharable val empty: GadtConstraint =
14+
def apply(): GadtConstraint = empty
15+
def empty: GadtConstraint =
1716
new ProperGadtConstraint(OrderingConstraint.empty, SimpleIdentityMap.empty, SimpleIdentityMap.empty, false)
1817

1918
/** Represents GADT constraints currently in scope */

0 commit comments

Comments
 (0)