File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
effekt/shared/src/main/scala/effekt/core Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -113,10 +113,14 @@ def solveConstraints(constraints: Constraints): Solution =
113
113
val groupedConstraints = constraints.groupBy(c => c.upper)
114
114
val vecConstraints = groupedConstraints.map((sym, constraints) => (sym -> constraints.map(c => c.lower)))
115
115
116
+ while (true ) {
117
+ val previousSolved = solved
116
118
vecConstraints.foreach((sym, tas) =>
117
119
val sol = solveConstraints(sym).map(bs => bs.toVector)
118
- solved += (sym -> sol)
119
- )
120
+ solved += (sym -> sol)
121
+ )
122
+ if (previousSolved == solved) return solved
123
+ }
120
124
121
125
def solveConstraints (funId : FunctionId ): Set [List [TypeArg .Base ]] =
122
126
val filteredConstraints = vecConstraints(funId)
@@ -127,7 +131,7 @@ def solveConstraints(constraints: Constraints): Solution =
127
131
b.foreach({
128
132
case TypeArg .Base (tpe) => l = productAppend(l, List (TypeArg .Base (tpe)))
129
133
case TypeArg .Var (funId, pos) =>
130
- val funSolved = solved.getOrElse(funId, solveConstraints(funId) )
134
+ val funSolved = solved.getOrElse(funId, Set .empty )
131
135
val posArgs = funSolved.map(v => v(pos))
132
136
l = posArgs.zipWithIndex.map((base, ind) => listFromIndex(ind) :+ base).toList
133
137
})
You can’t perform that action at this time.
0 commit comments