Skip to content

-XAutoDeriveTypeable fails to generate instances

The following doesn't compile with GHC 7.8.3, but works with GHC HEAD. I couldn't find a matching ticket, so I don't know if this was fixed knowingly or not...

{-# LANGUAGE AutoDeriveTypeable #-}

import Data.Typeable (Typeable)

data T1 = C1 Int
     deriving (Eq,Ord)

tvoid :: Typeable a => a -> IO ()
tvoid _ = return ()

main :: IO ()
main = tvoid (C1 0)
  1. ..fails for GHC 7.8.3 with
    No instance for (Typeable T1) arising from a use of ‘tvoid’
    In the expression: tvoid (C1 0)
    In an equation for ‘main’: main = tvoid (C1 0)

I'm marking this with high priority, as it makes -XAutoDeriveTypeable unusable on GHC 7.8.3 as it stands.

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