From 47d68d8bf2784235288b44d3a5d3883a5bb2a20e Mon Sep 17 00:00:00 2001 From: Evan Czaplicki Date: Tue, 13 Aug 2013 22:12:45 -0700 Subject: [PATCH] Succeed on programs that have no expressions --- compiler/Type/Constrain/Expression.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/Type/Constrain/Expression.hs b/compiler/Type/Constrain/Expression.hs index e3229ec..64b8f39 100644 --- a/compiler/Type/Constrain/Expression.hs +++ b/compiler/Type/Constrain/Expression.hs @@ -34,7 +34,8 @@ constrain env (L span expr) tipe = case expr of Literal lit -> Literal.constrain env span lit tipe - Var name -> return (name return (L span CSaveEnv) + | otherwise -> return (name exists $ \x -> do @@ -136,9 +137,7 @@ constrain env (L span expr) tipe = return ("Graphics.Element.markdown" - do c <- case body of - L _ (Var name) | name == saveEnvName -> return (L span CSaveEnv) - _ -> constrain env body tipe + do c <- constrain env body tipe (schemes, rqs, fqs, header, c2, c1) <- Monad.foldM (constrainDef env) ([], [], [], Map.empty, true, true)