summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile/Abstract
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-03-23 15:24:48 +0000
committerkrasimir <krasimir@chalmers.se>2010-03-23 15:24:48 +0000
commitc80c403da25b8b605e5616f7899f2a470ea00343 (patch)
tree80d83afc74384dc5cb7704f0796220018809261e /src/compiler/GF/Compile/Abstract
parent1e51690b71f13c877b19230e70b3be95a154e3ac (diff)
use the new more accurate location information for some error messages
Diffstat (limited to 'src/compiler/GF/Compile/Abstract')
-rw-r--r--src/compiler/GF/Compile/Abstract/TypeCheck.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/compiler/GF/Compile/Abstract/TypeCheck.hs b/src/compiler/GF/Compile/Abstract/TypeCheck.hs
index bddc6f0c0..74804983d 100644
--- a/src/compiler/GF/Compile/Abstract/TypeCheck.hs
+++ b/src/compiler/GF/Compile/Abstract/TypeCheck.hs
@@ -72,11 +72,10 @@ checkContext st = checkTyp st . cont2exp
checkTyp :: SourceGrammar -> Type -> [Message]
checkTyp gr typ = err (\x -> [text x]) ppConstrs $ justTypeCheck gr typ vType
-checkDef :: SourceGrammar -> Fun -> Type -> [L Equation] -> [Message]
-checkDef gr (m,fun) typ eqs = err (\x -> [text x]) ppConstrs $ do
- bcs <- mapM (\(L _ b) -> checkBranch (grammar2theory gr) (initTCEnv []) b (type2val typ)) eqs
- let (bs,css) = unzip bcs
- (constrs,_) <- unifyVal (concat css)
+checkDef :: SourceGrammar -> Fun -> Type -> Equation -> [Message]
+checkDef gr (m,fun) typ eq = err (\x -> [text x]) ppConstrs $ do
+ (b,cs) <- checkBranch (grammar2theory gr) (initTCEnv []) eq (type2val typ)
+ (constrs,_) <- unifyVal cs
return $ filter notJustMeta constrs
checkConstrs :: SourceGrammar -> Cat -> [Ident] -> [String]