Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#8479 closed bug (fixed)

Generic1 crashes with tyConStupidTheta when using associated type families

Reported by: ghorn Owned by: dreixel
Priority: normal Milestone:
Component: Compiler Version: 7.6.3
Keywords: Generics, Generic1 Cc: gregmainland@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case: generics/T8479
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


{-# OPTIONS_GHC -Wall #-}
{-# Language TypeFamilies #-}
{-# Language DeriveGeneric #-}

import GHC.Generics

class Blah (a :: * -> *) where
  type F a :: * -> *

data Foo (f :: * -> *) a = MkFoo ((F f) a) deriving Generic1

--data Foo a = MkFoo ((F f) a) deriving Generic1 -- also crashes

the above code crashes GHC with error:

[1 of 1] Compiling Main             ( GenericBug.hs, GenericBug.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.6.3 for x86_64-unknown-linux):
	tyConStupidTheta main:Main.F{tc ro4}

Please report this as a GHC bug:

Change History (6)

comment:1 Changed 6 years ago by simonpj

Owner: set to dreixel

Pedro, might you look?

comment:2 Changed 6 years ago by dreixel

Yes, I was actually just looking at it right now :-)

comment:3 Changed 6 years ago by ghorn

Cc: gregmainland@… added

comment:4 Changed 6 years ago by Jose Pedro Magalhaes <jpm@…>

In 2c74f9899ed5a99a4f6e8ea726841450c3d1211d/ghc:

fixing canDoGenerics1 (fixes #8468) (fixes #8479)

Signed-off-by: Jose Pedro Magalhaes <>

comment:5 Changed 6 years ago by dreixel

Resolution: fixed
Status: newclosed
Test Case: T8479

Fixed in HEAD, thanks.

comment:6 Changed 6 years ago by simonpj

Test Case: T8479generics/T8479
Note: See TracTickets for help on using tickets.