getLblType :: LIdent -> Val -> Typing (Tele, Env)\r
getLblType c (Ter (Sum _ _ cas) r) = case lookupLabel c cas of\r
Just as -> return (as,r)\r
- Nothing -> throwError ("getLblType: " ++ show c)\r
+ Nothing -> throwError ("getLblType: " ++ show c ++ " in " ++ show cas)\r
getLblType c u = throwError ("expected a data type for the constructor "\r
++ c ++ " but got " ++ show u)\r
\r
let (idents,tele,ters) = (declIdents d,declTele d,declTers d)\r
trace ("Checking: " ++ unwords idents)\r
checkTele tele\r
- rho <- asks env\r
- localM (addTele tele) $ checks (tele,rho) ters\r
+ local (addDecls d) $ do\r
+ rho <- asks env\r
+ checks (tele,rho) ters\r
\r
-- Check a telescope\r
checkTele :: Tele -> Typing ()\r