Skip to content

Commit d7ecb21

Browse files
committed
Use eq-based map for constraints
This makes the logic in ProtoTypes#constrained independent of whether we type lambdas are cached or uncached.
1 parent 442581d commit d7ecb21

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package dotc
33
package core
44

55
import Types._, Contexts._, Symbols._
6-
import util.SimpleMap
76
import collection.mutable
87
import printing.{Printer, Showable}
98
import printing.Texts._

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package dotc
33
package core
44

55
import Types._, Contexts._, Symbols._, Decorators._
6-
import util.SimpleMap
6+
import util.SimpleEqMap
77
import collection.mutable
88
import printing.{Printer, Showable}
99
import printing.Texts._
@@ -14,7 +14,7 @@ import annotation.tailrec
1414

1515
object OrderingConstraint {
1616

17-
type ArrayValuedMap[T] = SimpleMap[TypeLambda, Array[T]]
17+
type ArrayValuedMap[T] = SimpleEqMap[TypeLambda, Array[T]]
1818

1919
/** The type of `OrderingConstraint#boundsMap` */
2020
type ParamBounds = ArrayValuedMap[Type]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package core
55
import Types._
66
import Flags._
77
import Contexts._
8-
import util.{SimpleMap, DotClass}
8+
import util.{SimpleEqMap, DotClass}
99
import reporting._
1010
import printing.{Showable, Printer}
1111
import printing.Texts._
@@ -24,7 +24,7 @@ class TyperState(previous: TyperState /* | Null */) extends DotClass with Showab
2424
def setReporter(reporter: Reporter): this.type = { myReporter = reporter; this }
2525

2626
private var myConstraint: Constraint =
27-
if (previous == null) new OrderingConstraint(SimpleMap.Empty, SimpleMap.Empty, SimpleMap.Empty)
27+
if (previous == null) new OrderingConstraint(SimpleEqMap.Empty, SimpleEqMap.Empty, SimpleEqMap.Empty)
2828
else previous.constraint
2929

3030
def constraint = myConstraint

0 commit comments

Comments
 (0)