duplicate signatures disallowed
This commit is contained in:
parent
aa73f147f0
commit
32f8a3e8a9
2 changed files with 4 additions and 2 deletions
|
|
@ -85,8 +85,9 @@ checkPrg (Program bs) = do
|
|||
preRun :: [Def] -> Infer ()
|
||||
preRun [] = return ()
|
||||
preRun (x : xs) = case x of
|
||||
-- TODO: Check for no overlapping signature definitions
|
||||
DSig (Sig n t) -> insertSig (coerce n) (Just $ toNew t) >> preRun xs
|
||||
DSig (Sig n t) -> do
|
||||
gets (M.member (coerce n) . sigs) >>= flip when (throwError $ "Duplicate signatures for function '" ++ printTree n ++ "'")
|
||||
insertSig (coerce n) (Just $ toNew t) >> preRun xs
|
||||
DBind (Bind n _ _) -> do
|
||||
s <- gets sigs
|
||||
case M.lookup (coerce n) s of
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ data Bool () where {
|
|||
-- Cons x xs => x
|
||||
-- };
|
||||
|
||||
firstIsOne : List (Int) -> Bool () ;
|
||||
firstIsOne : List (Int) -> Bool () ;
|
||||
firstIsOne xs = case xs of {
|
||||
Cons x xs => case x of {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue