#7175: Panic when wrongly using a type family as return types for GADTs
--------------------------------+-------------------------------------------
 Reporter:  goldfire            |          Owner:                  
     Type:  bug                 |         Status:  new             
 Priority:  normal              |      Component:  Compiler        
  Version:  7.6.1-rc1           |       Keywords:                  
       Os:  Unknown/Multiple    |   Architecture:  Unknown/Multiple
  Failure:  Compile-time crash  |       Testcase:                  
Blockedby:                      |       Blocking:                  
  Related:                      |  
--------------------------------+-------------------------------------------
 The following code causes the following panic:

 {{{
 {-# LANGUAGE TypeFamilies, GADTs #-}

 type family F a

 data G1 a where
   G1C :: F Int

 data G2 a where
   G2C :: F Int
 }}}

 {{{
 ghc: panic! (the 'impossible' happened)
   (GHC version 7.6.0.20120810 for x86_64-apple-darwin):
         compiler/typecheck/TcTyClsDecls.lhs:1081:5-62: Irrefutable pattern
 failed for pattern Data.Maybe.Just subst
 }}}

 Admittedly, the code causing the panic is silly, but it happened to me as
 I was refactoring. Having two separate GADTs with the wrong return types
 seems necessary to cause the panic.

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