From: simonpj Date: Thu, 1 Mar 2001 17:07:13 +0000 (+0000) Subject: [project @ 2001-03-01 17:06:53 by simonpj] X-Git-Tag: Approximately_9120_patches~2494 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=f4c599d2460672cdeec7e6b3c4c99bb308a54b67;p=ghc-hetmet.git [project @ 2001-03-01 17:06:53 by simonpj] Add comment --- diff --git a/ghc/compiler/rename/RnEnv.lhs b/ghc/compiler/rename/RnEnv.lhs index 34a254e..5884c34 100644 --- a/ghc/compiler/rename/RnEnv.lhs +++ b/ghc/compiler/rename/RnEnv.lhs @@ -762,6 +762,8 @@ in error messages. \begin{code} unQualInScope :: GlobalRdrEnv -> Name -> Bool +-- True if 'f' is in scope, and has only one binding +-- (i.e. false if A.f and B.f are both in scope as unqualified 'f') unQualInScope env = (`elemNameSet` unqual_names) where diff --git a/ghc/compiler/rename/RnNames.lhs b/ghc/compiler/rename/RnNames.lhs index 76f7bdc..df1925d 100644 --- a/ghc/compiler/rename/RnNames.lhs +++ b/ghc/compiler/rename/RnNames.lhs @@ -198,6 +198,9 @@ importsFromLocalDecls this_mod decls (_, dups) = removeDups compare all_names in -- Check for duplicate definitions + -- The complaint will come out as "Multiple declarations of Foo.f" because + -- since 'f' is in the env twice, the unQualInScope used by the error-msg + -- printer returns False. It seems awkward to fix, unfortunately. mapRn_ (addErrRn . dupDeclErr) dups `thenRn_`