From: simonpj Date: Fri, 12 Aug 2005 08:32:16 +0000 (+0000) Subject: [project @ 2005-08-12 08:32:16 by simonpj] X-Git-Tag: Initial_conversion_from_CVS_complete~242 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=22df1e2a699d6eda6d5ada5073bc97c9f35e2947;p=ghc-hetmet.git [project @ 2005-08-12 08:32:16 by simonpj] Grr: another wibble to duplicate signature detection --- diff --git a/ghc/compiler/rename/RnBinds.lhs b/ghc/compiler/rename/RnBinds.lhs index 96ce11b..f067e5d 100644 --- a/ghc/compiler/rename/RnBinds.lhs +++ b/ghc/compiler/rename/RnBinds.lhs @@ -45,6 +45,7 @@ import Digraph ( SCC(..), stronglyConnComp ) import Bag import Outputable import Maybes ( orElse, fromJust, isJust ) +import Util ( filterOut ) import Monad ( foldM ) \end{code} @@ -501,14 +502,14 @@ check_sigs :: (LSig Name -> Bool) -> [LSig Name] -> RnM () check_sigs ok_sig sigs -- Check for (a) duplicate signatures -- (b) signatures for things not in this group - = do { mappM_ unknownSigErr (filter bad sigs) - ; mappM_ dupSigDeclErr (findDupsEq eqHsSig sigs) } + = do { mappM_ unknownSigErr (filter (not . ok_sig) sigs') + ; mappM_ dupSigDeclErr (findDupsEq eqHsSig sigs') } where -- Don't complain about an unbound name again - bad sig = not (ok_sig sig) && - case sigName sig of - Just n | isUnboundName n -> False - other -> True + sigs' = filterOut bad_name sigs + bad_name sig = case sigName sig of + Just n -> isUnboundName n + other -> False -- We use lookupLocatedSigOccRn in the signatures, which is a little bit unsatisfactory -- because this won't work for: