mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
added an argument place to ResOverload for extended overloads
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user