X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/3196000d8e29e14665f43ffd74460b2e6d592250..be1bea4c0a2a4cfa0b86beccfa423366b94b84b4:/src/order.sml diff --git a/src/order.sml b/src/order.sml index cf1dee1..0d0d363 100644 --- a/src/order.sml +++ b/src/order.sml @@ -70,7 +70,7 @@ fun unionCTE (((c1, t1), v1), ((c2, t2), v2)) = val dt = (TError, ErrorMsg.dummyLoc) -fun expNeeded G (e, _) = +fun expNeeded G (e, loc) = case e of EInt _ => ((SS.empty, if Env.lookupType G "int" then @@ -96,6 +96,13 @@ fun expNeeded G (e, _) = | SOME t => unionCTE ((typNeeded G t, SS.empty), expNeeded G' e) end + | EALam (x, p, e) => + let + val G' = Env.bindVal G (x, (TAction (p, StringMap.empty, StringMap.empty), loc), NONE) + in + unionCTE (((predNeeded G p, SS.empty), SS.empty), + expNeeded G' e) + end | EVar x => (case Env.lookupVal G x of NONE => ((SS.empty, SS.empty), SS.singleton x)