*** See "THE NAMING STORY" in HsDecls ****
\begin{code}
-mkClassDecl (cxt, cname, tyvars) fds sigs mbinds
+mkClassDecl (cxt, cname, tyvars) fds sigs mbinds ats
= ClassDecl { tcdCtxt = cxt, tcdLName = cname, tcdTyVars = tyvars,
tcdFDs = fds,
tcdSigs = sigs,
import {-# SOURCE #-} RnExpr( rnLExpr )
import HsSyn
-import RdrName ( RdrName, isRdrDataCon, isRdrTyVar, elemLocalRdrEnv,
- globalRdrEnvElts, GlobalRdrElt(..), isLocalGRE )
+import RdrName ( RdrName, isRdrDataCon, isRdrTyVar, rdrNameOcc,
+ elemLocalRdrEnv, globalRdrEnvElts, GlobalRdrElt(..),
+ isLocalGRE )
import RdrHsSyn ( extractGenericPatTyVars, extractHsRhoRdrTyVars )
import RnHsSyn
import RnTypes ( rnLHsType, rnLHsTypes, rnHsSigType, rnHsTypeFVs, rnContext )
import SrcLoc ( Located(..), unLoc, noLoc )
import DynFlags ( DynFlag(..) )
import Maybes ( seqMaybe )
-import Maybe ( isNothing )
+import Maybe ( isNothing, catMaybes )
import Monad ( liftM )
import BasicTypes ( Boxity(..) )
\end{code}
deriv_fvs) }
| otherwise -- GADT
- = ASSERT( null typats ) -- GADTs cannot have type patterns for now
+ = ASSERT( none typatsMaybe ) -- GADTs cannot have type patterns for now
do { tycon' <- lookupLocatedTopBndrRn tycon
; checkTc (null (unLoc context)) (badGadtStupidTheta tycon)
; tyvars' <- bindTyVarsRn data_doc tyvars
L _ (ConDecl { con_res = ResTyH98 }) : _ -> True
other -> False
+ none Nothing = True
+ none (Just []) = True
+ none _ = False
+
data_doc = text "In the data type declaration for" <+> quotes (ppr tycon)
con_names = map con_names_helper condecls
--
-- We check for respectable instance type, and context
tcLocalInstDecl1 decl@(L loc (InstDecl poly_ty binds uprags ats))
+ -- !!!TODO: Handle the `ats' parameter!!! -=chak
= -- Prime error recovery, set source location
- ASSERT( null ats )
- -- !!!TODO: Handle the `ats' parameter!!! -=chak
recoverM (returnM Nothing) $
setSrcSpan loc $
addErrCtxt (instDeclCtxt1 poly_ty) $