#3023: Wrong inferred type shown
-----------------------------+----------------------------------------------
Reporter:  guest             |          Owner:                  
    Type:  bug               |         Status:  new             
Priority:  normal            |      Component:  Compiler        
 Version:  6.10.1            |       Severity:  normal          
Keywords:                    |       Testcase:                  
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
-----------------------------+----------------------------------------------
 When the warning for missing type signatures is turned on the displayed
 type is sometimes totally bogus.

 {{{
 {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
 UndecidableInstances #-}
 module Bug where

 class C a b | a -> b, b -> a where
     f :: a -> b

 instance C Int Bool where
     f = undefined
 instance (C a c, C b d) => C (a -> b) (c -> d) where
     f = undefined

 foo :: Int -> Int
 foo = undefined

 bar = f foo
 }}}
 GHC says:
 {{{
     Warning: Definition but no type signature for `bar'
              Inferred type: bar :: c -> d
 }}}
 The type for bar is, of course, Bool->Bool, and nothing else.

   -- Lennart

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3023>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to