mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
eliminated copying of inherited overload branches
This commit is contained in:
@@ -1,3 +1,12 @@
|
|||||||
--# -path=.:alltenses-1.4:prelude
|
--# -path=.:alltenses-1.4:prelude
|
||||||
|
|
||||||
resource TryEng = SyntaxEng, LexiconEng, ParadigmsEng - [mkAdv] ;
|
resource TryEng = SyntaxEng - [mkAdv], LexiconEng, ParadigmsEng - [mkAdv] **
|
||||||
|
open (P = ParadigmsEng), (S = SyntaxEng) in {
|
||||||
|
|
||||||
|
oper
|
||||||
|
mkAdv = overload SyntaxEng {
|
||||||
|
mkAdv : Str -> Adv = P.mkAdv ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -232,16 +232,16 @@ checkResInfo gr mo mm (c,info) = do
|
|||||||
return (c, ResOper pty' pde')
|
return (c, ResOper pty' pde')
|
||||||
|
|
||||||
ResOverload os tysts -> chIn "overloading" $ do
|
ResOverload os tysts -> chIn "overloading" $ do
|
||||||
--tysts' <- mapM (uncurry $ flip check) tysts
|
tysts' <- mapM (uncurry $ flip check) tysts -- return explicit ones
|
||||||
tysts0 <- checkErr $ lookupOverload gr mo c
|
tysts0 <- checkErr $ lookupOverload gr mo c -- check against inherited ones too
|
||||||
tysts' <- mapM (uncurry $ flip check)
|
tysts1 <- mapM (uncurry $ flip check)
|
||||||
[(mkFunType args val,tr) | (args,(val,tr)) <- tysts0]
|
[(mkFunType args val,tr) | (args,(val,tr)) <- tysts0]
|
||||||
let tysts2 = [(y,x) | (x,y) <- tysts']
|
let tysts2 = [(y,x) | (x,y) <- tysts1]
|
||||||
--- this can only be a partial guarantee, since matching
|
--- this can only be a partial guarantee, since matching
|
||||||
--- with value type is only possible if expected type is given
|
--- with value type is only possible if expected type is given
|
||||||
checkUniq $
|
checkUniq $
|
||||||
sort [t : map snd xs | (x,_) <- tysts2, Ok (xs,t) <- [typeFormCnc x]]
|
sort [t : map snd xs | (x,_) <- tysts2, Ok (xs,t) <- [typeFormCnc x]]
|
||||||
return (c,ResOverload os tysts2)
|
return (c,ResOverload os [(y,x) | (x,y) <- tysts'])
|
||||||
|
|
||||||
ResParam (Yes (pcs,_)) -> chIn "parameter type" $ do
|
ResParam (Yes (pcs,_)) -> chIn "parameter type" $ do
|
||||||
---- mapM ((mapM (computeLType gr . snd)) . snd) pcs
|
---- mapM ((mapM (computeLType gr . snd)) . snd) pcs
|
||||||
|
|||||||
Reference in New Issue
Block a user