added an argument place to ResOverload for extended overloads

This commit is contained in:
aarne
2008-06-01 11:02:02 +00:00
parent b54c5ddb7c
commit 07c8a4383a
7 changed files with 30 additions and 19 deletions

View File

@@ -231,14 +231,14 @@ checkResInfo gr mo mm (c,info) = do
_ -> return (pty, pde) --- other cases are uninteresting
return (c, ResOper pty' pde')
ResOverload tysts -> chIn "overloading" $ do
ResOverload os tysts -> chIn "overloading" $ do
tysts' <- mapM (uncurry $ flip check) tysts
let tysts2 = [(y,x) | (x,y) <- tysts']
--- this can only be a partial guarantee, since matching
--- with value type is only possible if expected type is given
checkUniq $
sort [t : map snd xs | (x,_) <- tysts2, Ok (xs,t) <- [typeFormCnc x]]
return (c,ResOverload tysts2)
return (c,ResOverload os tysts2)
ResParam (Yes (pcs,_)) -> chIn "parameter type" $ do
---- mapM ((mapM (computeLType gr . snd)) . snd) pcs

View File

@@ -119,10 +119,10 @@ refreshModule (k,ms) mi@(i,m) = case m of
ResOper ptyp (Yes trm) -> do ---- refresh ptyp
(k',trm') <- refreshTermKN k trm
return $ (k', (c, ResOper ptyp (Yes trm')):cs)
ResOverload tyts -> do
ResOverload os tyts -> do
(k',tyts') <- liftM (\ (t,(_,i)) -> (i,t)) $
appSTM (mapPairsM refresh tyts) (initIdStateN k)
return $ (k', (c, ResOverload tyts'):cs)
return $ (k', (c, ResOverload os tyts'):cs)
CncCat mt (Yes trm) pn -> do ---- refresh mt, pn
(k',trm') <- refreshTermKN k trm
return $ (k', (c, CncCat mt (Yes trm') pn):cs)

View File

@@ -170,7 +170,8 @@ renameInfo mo status (i,info) = errIn
AbsTrans f -> liftM AbsTrans (rent f)
ResOper pty ptr -> liftM2 ResOper (ren pty) (ren ptr)
ResOverload tysts -> liftM ResOverload $ mapM (pairM rent) tysts
ResOverload os tysts ->
liftM2 ResOverload (mapM rent os) (mapM (pairM rent) tysts)
ResParam (Yes (pp,m)) -> do
pp' <- mapM (renameParam status) pp