id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
6147,GeneralizedNewtypeDeriving should fail with data families,rl,simonpj,"Here is an example:

{{{
{-# LANGUAGE GeneralizedNewtypeDeriving, TypeFamilies #-}
module Foo where

data family T a
data instance T Int = T_Int Int

class C a where
  foo :: a -> T a

instance C Int where
  foo = T_Int

newtype Foo = Foo Int deriving(C)
}}}

The `deriving(C)` clause on `Foo` should fail but instead it derives an instance which can't possible be correct since there is no corresponding `data instance T Foo`. This is closely related to #2721 (where newtype deriving was disabled in the presence of associated types) but much more difficult to test for. Probably also related to #1496.",bug,new,high,7.8.1,Compiler (Type checker),7.2.1,,,bos@… bgamari@… hackage.haskell.org@…,Unknown/Multiple,Unknown/Multiple,GHC accepts invalid program,Unknown,,,,
