summaryrefslogtreecommitdiff
path: root/src/GF/Compile
diff options
context:
space:
mode:
Diffstat (limited to 'src/GF/Compile')
-rw-r--r--src/GF/Compile/CheckGrammar.hs5
-rw-r--r--src/GF/Compile/Optimize.hs1
-rw-r--r--src/GF/Compile/Rename.hs1
3 files changed, 7 insertions, 0 deletions
diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs
index 8f152ff17..74256d66b 100644
--- a/src/GF/Compile/CheckGrammar.hs
+++ b/src/GF/Compile/CheckGrammar.hs
@@ -309,6 +309,11 @@ inferLType gr trm = case trm of
Vr ident -> termWith trm $ checkLookup ident
+ Typed e t -> do
+ t' <- comp t
+ check e t'
+ return (e,t')
+
App f a -> do
(f',fty) <- infer f
fty' <- comp fty
diff --git a/src/GF/Compile/Optimize.hs b/src/GF/Compile/Optimize.hs
index bb54df050..61ff8de32 100644
--- a/src/GF/Compile/Optimize.hs
+++ b/src/GF/Compile/Optimize.hs
@@ -166,6 +166,7 @@ mkLinDefault gr typ = do
let (ls,ts) = unzip r
ts' <- mapM mkDefField ts
return $ R $ [assign l t | (l,t) <- zip ls ts']
+ _ | isTypeInts typ -> return $ EInt 0 -- exists in all as first val
_ -> prtBad "linearization type field cannot be" typ
-- Form the printname: if given, compute. If not, use the computed
diff --git a/src/GF/Compile/Rename.hs b/src/GF/Compile/Rename.hs
index 6c3f964df..55708f629 100644
--- a/src/GF/Compile/Rename.hs
+++ b/src/GF/Compile/Rename.hs
@@ -158,6 +158,7 @@ renameTerm env vars = ren vars where
ren vs trm = case trm of
Abs x b -> liftM (Abs x) (ren (x:vs) b)
Prod x a b -> liftM2 (Prod x) (ren vs a) (ren (x:vs) b)
+ Typed a b -> liftM2 Typed (ren vs a) (ren vs b)
Vr x
| elem x vs -> return trm
| otherwise -> renid trm