#7352: this type signature in a case alternative does not typecheck and requires
ScopedTypeVariables
---------------------------------+------------------------------------------
    Reporter:  atnnn             |        Owner:  atnnn                  
        Type:  bug               |       Status:  closed                 
    Priority:  normal            |    Component:  Compiler (Type checker)
     Version:  7.6.1             |   Resolution:  invalid                
    Keywords:                    |           Os:  Unknown/Multiple       
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown           
    Testcase:                    |    Blockedby:                         
    Blocking:                    |      Related:                         
---------------------------------+------------------------------------------
Changes (by atnnn):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 This is not a bug, just the normal behaviour of GADTs

 {{{
 {-# LANGUAGE GADTs #-}

 data G a where
   G :: {unG :: a} -> G [a]

 test4 (G True) = ()
 }}}

 test4 fails with

 {{{
     Could not deduce (a ~ Bool)
     from the context (t ~ [a])
 }}}

 Here is a workaround that works

 {{{
 test5 g | True <- unG g = ()
 }}}

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