1
0
forked from GitHub/gf-core

for 'lincat C = T' the typechecker should check that T is a valid type

This commit is contained in:
krasimir
2009-11-13 10:25:31 +00:00
parent 5a63f221d7
commit 2ddefec2bc

View File

@@ -175,14 +175,15 @@ checkInfo ms (m,mo) c info = do
return (CncFun linty (Just trm') mpr) return (CncFun linty (Just trm') mpr)
CncCat (Just typ) mdef mpr -> chIn "linearization type of" $ do CncCat (Just typ) mdef mpr -> chIn "linearization type of" $ do
typ' <- computeLType gr [] typ (typ,_) <- checkLType gr [] typ typeType
mdef' <- case mdef of typ <- computeLType gr [] typ
mdef <- case mdef of
Just def -> do Just def -> do
(def',_) <- checkLType gr [] def (mkFunType [typeStr] typ) (def,_) <- checkLType gr [] def (mkFunType [typeStr] typ)
return $ Just def' return $ Just def
_ -> return mdef _ -> return mdef
mpr <- checkPrintname gr mpr mpr <- checkPrintname gr mpr
return (CncCat (Just typ') mdef' mpr) return (CncCat (Just typ) mdef mpr)
ResOper pty pde -> chIn "operation" $ do ResOper pty pde -> chIn "operation" $ do
(pty', pde') <- case (pty,pde) of (pty', pde') <- case (pty,pde) of