[project @ 2001-03-01 17:06:53 by simonpj]
authorsimonpj <unknown>
Thu, 1 Mar 2001 17:07:13 +0000 (17:07 +0000)
committersimonpj <unknown>
Thu, 1 Mar 2001 17:07:13 +0000 (17:07 +0000)
Add comment

ghc/compiler/rename/RnEnv.lhs
ghc/compiler/rename/RnNames.lhs

index 34a254e..5884c34 100644 (file)
@@ -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
index 76f7bdc..df1925d 100644 (file)
@@ -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_`