summaryrefslogtreecommitdiff
path: root/src-3.0/GF/Compile
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-03 09:21:24 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-03 09:21:24 +0000
commit8d98fec81eb0bc54cbc8b210c4045a52a0c09d79 (patch)
tree2e578bb28f7f04528cf2fccd710ff6a1e1749013 /src-3.0/GF/Compile
parent9dbf9c56609132c7a3731819b53e73045c430e3b (diff)
overload extension: syntax overload OldModule* {def*}
Diffstat (limited to 'src-3.0/GF/Compile')
-rw-r--r--src-3.0/GF/Compile/CheckGrammar.hs9
-rw-r--r--src-3.0/GF/Compile/Rename.hs2
2 files changed, 7 insertions, 4 deletions
diff --git a/src-3.0/GF/Compile/CheckGrammar.hs b/src-3.0/GF/Compile/CheckGrammar.hs
index 2fb4f5895..c580149dc 100644
--- a/src-3.0/GF/Compile/CheckGrammar.hs
+++ b/src-3.0/GF/Compile/CheckGrammar.hs
@@ -232,7 +232,10 @@ checkResInfo gr mo mm (c,info) = do
return (c, ResOper pty' pde')
ResOverload os tysts -> chIn "overloading" $ do
- tysts' <- mapM (uncurry $ flip check) tysts
+ --tysts' <- mapM (uncurry $ flip check) tysts
+ tysts0 <- checkErr $ lookupOverload gr mo c
+ tysts' <- mapM (uncurry $ flip check)
+ [(mkFunType args val,tr) | (args,(val,tr)) <- tysts0]
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
@@ -256,8 +259,8 @@ checkResInfo gr mo mm (c,info) = do
checkUniq xss = case xss of
x:y:xs
- | x == y -> raise $ "ambiguous for argument list" +++
- unwords (map (prtType gr) x)
+ | x == y -> raise $ "ambiguous for type" +++
+ prtType gr (mkFunType (init x) (last x))
| otherwise -> checkUniq $ y:xs
_ -> return ()
diff --git a/src-3.0/GF/Compile/Rename.hs b/src-3.0/GF/Compile/Rename.hs
index 14c25c32b..7b4d09277 100644
--- a/src-3.0/GF/Compile/Rename.hs
+++ b/src-3.0/GF/Compile/Rename.hs
@@ -171,7 +171,7 @@ renameInfo mo status (i,info) = errIn
ResOper pty ptr -> liftM2 ResOper (ren pty) (ren ptr)
ResOverload os tysts ->
- liftM2 ResOverload (mapM rent os) (mapM (pairM rent) tysts)
+ liftM (ResOverload os) (mapM (pairM rent) tysts)
ResParam (Yes (pp,m)) -> do
pp' <- mapM (renameParam status) pp