Skip to content
Snippets Groups Projects
Commit a0660319 authored by Nicolas Voirol's avatar Nicolas Voirol Committed by Ravi
Browse files

Small fix for required lambda in ensuring

parent 86649c4b
No related branches found
No related tags found
No related merge requests found
...@@ -81,7 +81,10 @@ class Path private[purescala]( ...@@ -81,7 +81,10 @@ class Path private[purescala](
def wrap(e: Expr) = fold[Expr](e, let, (_, res) => res)(rest) def wrap(e: Expr) = fold[Expr](e, let, (_, res) => res)(rest)
val req = Require(Constructors.and(cond, wrap(pre)), wrap(body)) val req = Require(Constructors.and(cond, wrap(pre)), wrap(body))
val full = if (post != NoTree(BooleanType)) Ensuring(req, wrap(post)) else req val full = post match {
case l @ Lambda(args, body) => Ensuring(req, Lambda(args, wrap(body)).copiedFrom(l))
case _ => req
}
fold[Expr](full, let, (_, _) => scala.sys.error("Should never happen!"))(outers) fold[Expr](full, let, (_, _) => scala.sys.error("Should never happen!"))(outers)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment