X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypes%2FTyCon.lhs;fp=compiler%2Ftypes%2FTyCon.lhs;h=2958107367318bd9062e98e23fe00704122aab54;hp=235097369f22fe8e600fed4377757b3240a75390;hb=bee517d218a9546db88ee3ad4e15fb2010562e4a;hpb=35a77384d096e9cec8488f09ddaee533ad61051a diff --git a/compiler/types/TyCon.lhs b/compiler/types/TyCon.lhs index 2350973..2958107 100644 --- a/compiler/types/TyCon.lhs +++ b/compiler/types/TyCon.lhs @@ -582,7 +582,7 @@ data CoTyConDesc Note [Enumeration types] ~~~~~~~~~~~~~~~~~~~~~~~~ -We define datatypes with no constructors to not be +We define datatypes with no constructors to *not* be enumerations; this fixes trac #2578, Otherwise we end up generating an empty table for __closure_tbl @@ -590,6 +590,16 @@ which is used by tagToEnum# to map Int# to constructors in an enumeration. The empty table apparently upset the linker. +Moreover, all the data constructor must be enumerations, meaning +they have type (forall abc. T a b c). GADTs are not enumerations. +For example consider + data T a where + T1 :: T Int + T2 :: T Bool + T3 :: T a +What would [T1 ..] be? [T1,T3] :: T Int? Easiest thing is to exclude them. +See Trac #4528. + Note [Newtype coercions] ~~~~~~~~~~~~~~~~~~~~~~~~ The NewTyCon field nt_co is a a TyCon (a coercion constructor in fact)