Skip to content
Snippets Groups Projects
Commit aaac8c2f authored by Philippe Suter's avatar Philippe Suter
Browse files

handling LetTuple in simplifyPaths

parent b29468d1
Branches
Tags
No related merge requests found
...@@ -1245,6 +1245,11 @@ object TreeOps { ...@@ -1245,6 +1245,11 @@ object TreeOps {
val se = rec(e, path) val se = rec(e, path)
Let(i, se, rec(b, Equals(Variable(i), se) +: path)) Let(i, se, rec(b, Equals(Variable(i), se) +: path))
case LetTuple(is, e, b) =>
// Similar to the Let case
val se = rec(e, path)
LetTuple(is, se, rec(b, Equals(Tuple(is.map(Variable(_))), se) +: path))
case IfExpr(cond, then, elze) => case IfExpr(cond, then, elze) =>
val rc = rec(cond, path) val rc = rec(cond, path)
rc match { rc match {
......
...@@ -83,10 +83,9 @@ object Trees { ...@@ -83,10 +83,9 @@ object Trees {
case class Tuple(exprs: Seq[Expr]) extends Expr { case class Tuple(exprs: Seq[Expr]) extends Expr {
val subTpes = exprs.map(_.getType).map(bestRealType) val subTpes = exprs.map(_.getType).map(bestRealType)
if(!subTpes.exists(_ == Untyped)) { if(subTpes.forall(_ != Untyped)) {
setType(TupleType(subTpes)) setType(TupleType(subTpes))
} }
} }
// This must be 1-indexed ! // This must be 1-indexed !
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment