id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
2701,Cannot derive Data for structures containing unboxed values,batterseapower,igloo,"Trying to compile this:

{{{
{-# LANGUAGE MagicHash, DeriveDataTypeable #-}
module Test where

import GHC.Prim

import Data.Data
import Data.Typeable

data Foo = MkFoo Int#
         deriving (Typeable, Data)
}}}

Results in an error:

{{{
$ ghc/stage1-inplace/ghc --make ~/DerivingUnboxed.hs 
[1 of 1] Compiling Test             ( /Users/mbolingbroke/DerivingUnboxed.hs, /Users/mbolingbroke/DerivingUnboxed.o )

/Users/mbolingbroke/DerivingUnboxed.hs:10:29:
    Couldn't match kind `#' against `*'
    When matching the kinds of `Int# :: #' and `d :: *'
      Expected type: d
      Inferred type: Int#
    In the first argument of `z', namely `MkFoo'

/Users/mbolingbroke/DerivingUnboxed.hs:10:29:
    Couldn't match kind `#' against `*'
    When matching the kinds of `Int# :: #' and `b :: *'
      Expected type: b
      Inferred type: Int#
    In the first argument of `z', namely `MkFoo'
}}}

I'm not sure if this is really a bug or not. It might be nice if deriving Data handled this case by reboxing Int#, or alternatively if it gave a clear error messages about not being able to handle unboxed values.",merge,closed,normal,6.10.1,Compiler,6.10.1,fixed,,,Unknown/Multiple,Unknown/Multiple,,Unknown,deriving/should_fail/T2701,,,
