From 2ddefec2bc6c66f697a498baf023dc9eb0aca36d Mon Sep 17 00:00:00 2001 From: krasimir Date: Fri, 13 Nov 2009 10:25:31 +0000 Subject: [PATCH] for 'lincat C = T' the typechecker should check that T is a valid type --- src/GF/Compile/CheckGrammar.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs index ed9c67927..f4765eb26 100644 --- a/src/GF/Compile/CheckGrammar.hs +++ b/src/GF/Compile/CheckGrammar.hs @@ -175,14 +175,15 @@ checkInfo ms (m,mo) c info = do return (CncFun linty (Just trm') mpr) CncCat (Just typ) mdef mpr -> chIn "linearization type of" $ do - typ' <- computeLType gr [] typ - mdef' <- case mdef of + (typ,_) <- checkLType gr [] typ typeType + typ <- computeLType gr [] typ + mdef <- case mdef of Just def -> do - (def',_) <- checkLType gr [] def (mkFunType [typeStr] typ) - return $ Just def' + (def,_) <- checkLType gr [] def (mkFunType [typeStr] typ) + return $ Just def _ -> return mdef mpr <- checkPrintname gr mpr - return (CncCat (Just typ') mdef' mpr) + return (CncCat (Just typ) mdef mpr) ResOper pty pde -> chIn "operation" $ do (pty', pde') <- case (pty,pde) of