#1723: type unsafety with type family + GADT
----------------------------------------+-----------------------------------
    Reporter:  [EMAIL PROTECTED]       |        Owner:         
        Type:  bug                      |       Status:  new    
    Priority:  normal                   |    Milestone:         
   Component:  Compiler (Type checker)  |      Version:  6.8    
    Severity:  major                    |   Resolution:         
    Keywords:                           |   Difficulty:  Unknown
          Os:  Unknown                  |     Testcase:         
Architecture:  Unknown                  |  
----------------------------------------+-----------------------------------
Comment (by toms):

 The current work-around is to write:
 {{{
    data T a where T :: b ~ Const a => a -> T b
 }}}
 in order to get the correct error message:
 {{{
    Couldn't match expected type `b' against inferred type `a1'
       `b' is a rigid type variable bound by
           the type signature for `coerce' at bug.hs:8:19
       `a1' is a rigid type variable bound by
            the constructor `T' at bug.hs:10:11
     In the expression: y
     In a case alternative: T y -> y
     In the expression: case T x :: T (Const b) of T y -> y
 -- VISUAL --
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1723>
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