[GHC] #8468: ghc panic in deriving Generic1 on Array#

GHC ghc-devs at haskell.org
Mon Oct 21 15:40:58 UTC 2013


#8468: ghc panic in deriving Generic1 on Array#
-----------------------------------+---------------------------------------
       Reporter:  ghorn            |             Owner:
           Type:  bug              |            Status:  new
       Priority:  normal           |         Milestone:
      Component:  Compiler         |           Version:  7.6.3
       Keywords:                   |  Operating System:  Unknown/Multiple
   Architecture:                   |   Type of failure:  Compile-time crash
  Unknown/Multiple                 |         Test Case:
     Difficulty:  Unknown          |          Blocking:
     Blocked By:                   |
Related Tickets:                   |
-----------------------------------+---------------------------------------
 Compiling the following code
 {{{
 {-# Language DeriveGeneric, MagicHash #-}

 module Test where

 import GHC.Generics
 import GHC.Prim

 data Array a = Array (Array# a)
 newtype Vec a = MkVec {unVec :: Array a} deriving Generic1
 }}}
 causes panic:
 {{{
 [1 of 1] Compiling Test             ( Test.hs, Test.o )
 ghc: panic! (the 'impossible' happened)
   (GHC version 7.6.3 for x86_64-unknown-linux):
         No match in record selector tyConTyVars

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

 some comments from IRC:

 <monoidal> with deriving Generic1 we get "Can't make a derived instance of
 `Generic1 Array': Array must not have unlifted or polymorphic arguments" -
 so it seems the check is not done recursively on used types
 <monoidal> * deriving Generic1 on Array

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8468>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list