From 7a7b60449c14edc5448b0b40f81e119ed6a6f2ba Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sat, 22 Mar 2008 19:04:34 +0000 Subject: [PATCH] Enhanced an error message in RainTypes --- frontends/RainTypes.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontends/RainTypes.hs b/frontends/RainTypes.hs index 593323b..d590801 100644 --- a/frontends/RainTypes.hs +++ b/frontends/RainTypes.hs @@ -151,7 +151,10 @@ matchParamPass = everywhereM ((mkM matchParamPassProc) `extM` matchParamPassFunc then do transActualParams <- mapM (doExpParam m (A.nameName n)) (zip3 [0..] expectedParams actualParams) return $ A.FunctionCall m n transActualParams else dieP m $ "Wrong number of parameters given to function call; expected: " ++ show (length expectedParams) ++ " but found: " ++ show (length actualParams) - _ -> dieP m $ "Attempt to make a function call with something that is not a function: \"" ++ (show $ A.nameName n) ++ "\"" + _ -> dieP m $ "Attempt to make a function call with something" + ++ " that is not a function: \"" ++ A.nameName n + ++ "\"; is actually: " ++ showConstr (toConstr $ + A.ndType def) matchParamPassFunc e = return e --Checks the type of a parameter (A.Actual), and inserts a cast if it is safe to do so