id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
7391	"""The 'impossible' happened"" trying to derive Binary for a data instance"	ydewit		"I was trying to automatically derive Binary for a data instance (data family) and was trying to work around the fact that ""derive makeBinary"" expects a Name and not an expression by using a type alias. This is when I got the GHC compilation error.

This is a simple test case:
{{{

import           Data.Binary                         (Binary (..), putWord8, getWord8)
import           Data.DeriveTH

newtype Id a = Id String deriving Show

data family Cmd a

data instance Cmd (Id AData)
	= A1
	| A2

type ADataCmd = Cmd (Id AData)
$( derive makeBinary ''ADataCmd)
}}}

And here the compilation error:
{{{
  ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.1 for i386-apple-darwin):
	Could not convert Dec to Decl
}}}"	bug	closed	normal		Compiler	7.4.1	invalid		ndmitchell@…	MacOS X	x86	Compile-time crash	Unknown				
