#7164: Confusing "not a (visible) method" warning when method name clashes with
another definition
-----------------------------------------------+----------------------------
 Reporter:  joeyadams                          |          Owner:                
  
     Type:  bug                                |         Status:  new           
  
 Priority:  normal                             |      Component:  Compiler      
  
  Version:  7.6.1-rc1                          |       Keywords:                
  
       Os:  Unknown/Multiple                   |   Architecture:  
Unknown/Multiple
  Failure:  Incorrect warning at compile-time  |       Testcase:                
  
Blockedby:                                     |       Blocking:                
  
  Related:                                     |  
-----------------------------------------------+----------------------------
 Given this code:

 {{{
 class Foo m where
     herp :: (a -> a) -> m b -> m b
     derp :: m a

 derp :: Int
 derp = 123
 }}}

 GHC 7.4.1, 7.4.2, and 7.6.0.20120810 (rc1) produce the following output:

 {{{
 not-visible-method.hs:3:5:
     `derp' is not a (visible) method of class `Foo'

 not-visible-method.hs:6:1:
     Multiple declarations of `derp'
     Declared at: not-visible-method.hs:3:5
                  not-visible-method.hs:6:1
 }}}

 The second error makes sense, but the first one is bogus.  I'm defining
 class `Foo`!  If I remove the clashing `derp`, the module compiles.

 GHC 7.0.3 and 7.2.2 produce the correct output.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7164>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to