[GHC] #1430: getC: Type signature needed when existential types are used but not in the type signature

GHC trac at galois.com
Sat Jun 16 18:13:28 EDT 2007


#1430: getC: Type signature needed when existential types are used but not in the
type signature
--------------------------------------+-------------------------------------
  Reporter:  igloo                    |          Owner:         
      Type:  bug                      |         Status:  new    
  Priority:  high                     |      Milestone:  6.8    
 Component:  Compiler (Type checker)  |        Version:  6.6.1  
  Severity:  normal                   |       Keywords:         
Difficulty:  Unknown                  |             Os:  Unknown
  Testcase:  getC                     |   Architecture:  Unknown
--------------------------------------+-------------------------------------
This module:
 {{{
 {-# OPTIONS -fglasgow-exts #-}
 module Q where

 import Data.Typeable

 data ExTypeable = forall a. Typeable a => ExTypeable a

 -- unExTypeable :: Typeable h => ExTypeable -> Maybe h
 unExTypeable (ExTypeable a) = cast a
 }}}
 with the type signature commented out gives this in the HEAD:
 {{{
 q.hs:10:30:
     Could not deduce (Typeable b) from the context (Typeable a)
       arising from a use of `cast' at q.hs:10:30-35
     Possible fix:
       add (Typeable b) to the context of the constructor `ExTypeable'
     In the expression: cast a
     In the definition of `unExTypeable':
         unExTypeable (ExTypeable a) = cast a
 }}}
 It works in 6.6.

 It's part of the getC test.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1430>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
-------------- next part --------------
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs at haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


More information about the Glasgow-haskell-bugs mailing list