Skip to content

Commit cf244aa

Browse files
committed
fix compilation error
1 parent 20e73a9 commit cf244aa

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

compiler/shared/main/scala/mlscript/compiler/ClassLifter.scala

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ class ClassLifter(logDebugMsg: Boolean = false) {
510510
val nlhs = liftType(lb)
511511
val nrhs = liftType(ub)
512512
Bounds(nlhs._1, nrhs._1) -> (nlhs._2 ++ nrhs._2)
513-
case Constrained(base: Type, bounds, where) =>
513+
case Constrained(base: Type, bounds, where, tscs) =>
514514
val (nTargs, nCtx) = bounds.map { case (tv, Bounds(lb, ub)) =>
515515
val nlhs = liftType(lb)
516516
val nrhs = liftType(ub)
@@ -521,10 +521,18 @@ class ClassLifter(logDebugMsg: Boolean = false) {
521521
val nrhs = liftType(ub)
522522
Bounds(nlhs._1, nrhs._1) -> (nlhs._2 ++ nrhs._2)
523523
}.unzip
524+
val (tscs0, nCtx3) = tscs.map { case (tvs, cs) =>
525+
val (ntvs,c0) = tvs.map { case (p,v) =>
526+
val (nv, c) = liftType(v)
527+
(p,nv) -> c
528+
}.unzip
529+
val (ncs,c1) = cs.map(_.map(liftType).unzip).unzip
530+
(ntvs,ncs) -> (c0 ++ c1.flatten)
531+
}.unzip
524532
val (nBase, bCtx) = liftType(base)
525-
Constrained(nBase, nTargs, bounds2) ->
526-
((nCtx ++ nCtx2).fold(emptyCtx)(_ ++ _) ++ bCtx)
527-
case Constrained(_, _, _) => die
533+
Constrained(nBase, nTargs, bounds2, tscs0) ->
534+
((nCtx ++ nCtx2 ++ nCtx3.flatten).fold(emptyCtx)(_ ++ _) ++ bCtx)
535+
case Constrained(_, _, _, _) => die
528536
case Function(lhs, rhs) =>
529537
val nlhs = liftType(lhs)
530538
val nrhs = liftType(rhs)

0 commit comments

Comments
 (0)