summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile/Optimize.hs
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2011-02-25 17:01:10 +0000
committeraarne <aarne@chalmers.se>2011-02-25 17:01:10 +0000
commit445a3aafebe02c415c76392399bdf77a00e680f5 (patch)
treedc8a3350f1dc2ebd90eb35d632273c629f2b97c3 /src/compiler/GF/Compile/Optimize.hs
parent77b02544fb91a658346f25019cbf2a21b79f9081 (diff)
Predef.error surfaces as error message in compilation and cc command
Diffstat (limited to 'src/compiler/GF/Compile/Optimize.hs')
-rw-r--r--src/compiler/GF/Compile/Optimize.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/GF/Compile/Optimize.hs b/src/compiler/GF/Compile/Optimize.hs
index 43d7cde95..10f6c08be 100644
--- a/src/compiler/GF/Compile/Optimize.hs
+++ b/src/compiler/GF/Compile/Optimize.hs
@@ -112,7 +112,8 @@ partEval opts gr (context, val) trm = errIn (render (text "partial evaluation" <
trm3 <- if rightType trm2
then computeTerm gr subst trm2
else recordExpand val trm2 >>= computeTerm gr subst
- return $ mkAbs [(Explicit,v) | v <- vars] trm3
+ trm4 <- checkPredefError gr trm3
+ return $ mkAbs [(Explicit,v) | v <- vars] trm4
where
-- don't eta expand records of right length (correct by type checking)
rightType (R rs) = case val of
@@ -199,3 +200,4 @@ replace old new trm =
R _ | trm == old -> new
App x y -> App (replace old new x) (replace old new y)
_ -> composSafeOp (replace old new) trm
+