From f4c599d2460672cdeec7e6b3c4c99bb308a54b67 Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 1 Mar 2001 17:07:13 +0000 Subject: [PATCH] [project @ 2001-03-01 17:06:53 by simonpj] Add comment --- ghc/compiler/rename/RnEnv.lhs | 2 ++ ghc/compiler/rename/RnNames.lhs | 3 +++ 2 files changed, 5 insertions(+) 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_` -- 1.7.10.4