[GHC] #5211: Missing warning about redundant import for a class instance
GHC
cvs-ghc at haskell.org
Sat Jun 11 16:07:11 CEST 2011
#5211: Missing warning about redundant import for a class instance
---------------------------------------+------------------------------------
Reporter: Lemming | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 6.12.3
Resolution: fixed | Keywords:
Testcase: rename/should_fail/T5211 | Blockedby:
Difficulty: | Os: Unknown/Multiple
Blocking: | Architecture: Unknown/Multiple
Failure: None/Unknown |
---------------------------------------+------------------------------------
Changes (by simonpj):
* status: new => closed
* testcase: => rename/should_fail/T5211
* resolution: => fixed
Comment:
Excellent point thank you! Fixed by
{{{
commit 6f60f1f541cafdb3bfdd71d48eb9dd7f0a708bda
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Sat Jun 11 14:19:44 2011 +0100
Fix tracking of what RdrNames are used (fixes Trac #5211)
The issue here was: what import declaration brings into
scope the 'op here
import qualified Foo( op )
import Bar( C(op) )
instance C Int where
op = ...
Well, the import of Bar, obviously. But what if the
import Bar had been
import Bar( C )
Then the instance is still supposed to work, getting
op from the Foo.op imported from Foo. (I'm assuming its
the same op, of course.)
>---------------------------------------------------------------
compiler/basicTypes/RdrName.lhs | 2 +-
compiler/ghci/Debugger.hs | 1 -
compiler/rename/RnEnv.lhs | 35
++++++++++++++++++++++++++---------
3 files changed, 27 insertions(+), 11 deletions(-)
}}}
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5211#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list