Skip to content

Commit a2f9203

Browse files
committed
Add type for solved constraints
1 parent 1f00338 commit a2f9203

File tree

1 file changed

+6
-6
lines changed
  • effekt/shared/src/main/scala/effekt/core

1 file changed

+6
-6
lines changed

effekt/shared/src/main/scala/effekt/core/Mono.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ enum PolyType {
5858
}
5959

6060
type PolyConstraints = Map[Id, Set[PolyType]]
61-
type PolyConstraintEntry = (Id, Set[PolyType])
61+
type PolyConstraintsSolved = Map[Id, Set[PolyType.Base]]
6262

63-
def solveConstraints(constraints: PolyConstraints): PolyConstraints =
64-
var solved: PolyConstraints = Map()
63+
def solveConstraints(constraints: PolyConstraints): PolyConstraintsSolved =
64+
var solved: PolyConstraintsSolved = Map()
6565

66-
def solveConstraint(sym: Id, types: Set[PolyType]): Set[PolyType] =
67-
var polyTypes: Set[PolyType] = Set()
66+
def solveConstraint(sym: Id, types: Set[PolyType]): Set[PolyType.Base] =
67+
var polyTypes: Set[PolyType.Base] = Set()
6868
types.foreach {
6969
case PolyType.Var(symbol) => polyTypes ++= solved.getOrElse(symbol, solveConstraint(symbol, constraints.getOrElse(symbol, Set())))
70-
case base => polyTypes += base
70+
case PolyType.Base(tpe) => polyTypes += PolyType.Base(tpe)
7171
}
7272
solved += (sym -> polyTypes)
7373
polyTypes

0 commit comments

Comments
 (0)