Skip to content

Standalone deriving Generic on type with instantiated arguments

Reiner Pope reports that the following code

{-# LANGUAGE DeriveGeneric, FlexibleInstances, StandaloneDeriving #-}
import GHC.Generics
data T a = T a
deriving instance Generic (T Bool)

generates the following:

instance Generic (T Bool) where ...
type instance Rep (T a) = ...

This is wrong. The type instance should probably be for Rep (T Bool). Or perhaps we should refuse to derive Generic for instantiated types altogether.

Trac metadata
Trac field Value
Version 7.4.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC reiner.pope@gmail.com
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information