Skip to content

Commit

Permalink
Avoid sharing a mutable empty GadtConstraint!
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand committed Oct 17, 2022
1 parent 4e8a1a6 commit e6a9ffd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler/src/dotty/tools/dotc/core/GadtConstraint.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import util.{SimpleIdentitySet, SimpleIdentityMap}
import collection.mutable
import printing._

import scala.annotation.internal.sharable

object GadtConstraint:
@sharable val empty: GadtConstraint =
def apply(): GadtConstraint = empty
def empty: GadtConstraint =
new ProperGadtConstraint(OrderingConstraint.empty, SimpleIdentityMap.empty, SimpleIdentityMap.empty, false)

/** Represents GADT constraints currently in scope */
Expand Down

0 comments on commit e6a9ffd

Please sign in to comment.