From c2636ea9688fd89df7a13f53970e699c99997fe3 Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 22 Feb 2006 11:13:42 +0000 Subject: testing precompiled libraries --- src/GF/Compile/CheckGrammar.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/GF/Compile') diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs index 2e03b59ec..eaf9bc819 100644 --- a/src/GF/Compile/CheckGrammar.hs +++ b/src/GF/Compile/CheckGrammar.hs @@ -758,16 +758,16 @@ checkEqLType :: LTEnv -> Type -> Type -> Term -> Check Type checkEqLType env t u trm = do t' <- comp t u' <- comp u - case alpha [] t' u' of + case t' == u' || alpha [] t' u' of True -> return t' -- forgive missing lock fields by only generating a warning. --- better: use a flag to forgive (AR 31/1/2006) _ -> case missingLock [] t' u' of - Just lo -> do + Ok lo -> do checkWarn $ "missing lock field" +++ unwords (map prt lo) return t' - _ -> raise ("type of" +++ prt trm +++ - ": expected" +++ prt t' ++ ", inferred" +++ prt u') + Bad s -> raise (s ++ "type of" +++ prt trm +++ + ": expected" ++++ prt t' ++++ "inferred" ++++ prt u') where -- t is a subtype of u @@ -818,9 +818,9 @@ checkEqLType env t u trm = do not (any (\ (k,b) -> alpha g a b && l == k) ts)] (locks,others) = partition isLockLabel ls in case others of - _:_ -> Nothing + _:_ -> Bad $ "missing record fieds" +++ unwords (map prt others) _ -> return locks - _ -> Nothing + _ -> Bad "" sTypes = [typeStr, typeTok, typeString] comp = computeLType env -- cgit v1.2.3