#7006: Panic when promoted GADT arguments cross module boundaries
--------------------------------+-------------------------------------------
 Reporter:  anders_             |          Owner:                
     Type:  bug                 |         Status:  new           
 Priority:  normal              |      Component:  Compiler      
  Version:  7.4.1               |       Keywords:  DataKinds     
       Os:  MacOS X             |   Architecture:  x86_64 (amd64)
  Failure:  Compile-time crash  |       Testcase:                
Blockedby:                      |       Blocking:                
  Related:                      |  
--------------------------------+-------------------------------------------
 This seems to only happen when the importing module is compiled in a
 separate invocation of GHC from the module containing the GADT. That is,
 it happens with `ghc -c`-ing the two separately, or with `--make`, when
 only the importing module has been changed since last time. Cleaning
 between each compile seems to be a workaround, but that’s a massive pain.
 `:)`

 Sample code & GHC's reaction:

 {{{
 {-# LANGUAGE KindSignatures, TypeOperators, DataKinds, GADTs #-}
 module A where

 data List (xs :: [*]) where
   N    :: List '[]
   (:>) :: x -> List xs -> List (x ': xs)
 }}}

 {{{
 {-# LANGUAGE GADTs, TypeOperators #-}
 module B where
 import A

 foo :: List (x ': xs) -> x
 foo (x :> _) = x
 }}}

 {{{
 $ ghc -c A.hs
 $ ghc -c B.hs
 ghc: panic! (the 'impossible' happened)
   (GHC version 7.4.1 for x86_64-apple-darwin):
         tyThingTyCon Data constructor `ghc-prim:GHC.Types.:{(w) d 64}'

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 }}}

 (As an aside, it’s kind of annoying that `TypeOperators` isn’t
 automatically implied by `DataKinds`, but that’s not important really.)

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