Fixing little bugs during first deleuze/mire test
[hcoop/domtool2.git] / src / order.sml
index cf1dee1..0d0d363 100644 (file)
@@ -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)