+tcConDecl unbox_strict DataType tycon tc_tvs -- GADTs
+ decl@(GadtDecl name con_ty)
+ = do { traceTc (text "tcConDecl" <+> ppr name)
+ ; (tvs, theta, bangs, arg_tys, tc, res_tys) <- tcLHsConSig con_ty
+
+ ; traceTc (text "tcConDecl1" <+> ppr name)
+ ; let -- Now dis-assemble the type, and check its form
+ is_vanilla = null theta && mkTyVarTys tvs `tcEqTypes` res_tys
+
+ -- Vanilla datacons guarantee to use the same
+ -- type variables as the parent tycon
+ (tvs', arg_tys', res_tys')
+ | is_vanilla = (tc_tvs, substTys subst arg_tys, substTys subst res_tys)
+ | otherwise = (tvs, arg_tys, res_tys)
+ subst = zipTopTvSubst tvs (mkTyVarTys tc_tvs)
+
+ ; traceTc (text "tcConDecl3" <+> ppr name)
+ ; buildDataCon (unLoc name) False {- Not infix -} is_vanilla
+ (argStrictness unbox_strict tycon bangs arg_tys)
+ [{- No field labels -}]
+ tvs' theta arg_tys' tycon res_tys' }
+
+-------------------
+tcStupidTheta :: LHsContext Name -> [LConDecl Name] -> TcM (Maybe ThetaType)
+-- For GADTs we don't allow a context on the data declaration
+-- whereas for standard Haskell style data declarations, we do
+tcStupidTheta ctxt (L _ (ConDecl _ _ _ _) : _)
+ = do { theta <- tcHsKindedContext ctxt; return (Just theta) }
+tcStupidTheta ctxt other -- Includes an empty constructor list
+ = ASSERT( null (unLoc ctxt) ) return Nothing
+
+-------------------