Big tidy-up of deriving code
[ghc-hetmet.git] / compiler / rename / RnSource.lhs
index 08e6860..9653bdc 100644 (file)
@@ -422,11 +422,10 @@ extendTyVarEnvForMethodBinds tyvars thing_inside
 
 \begin{code}
 rnSrcDerivDecl :: DerivDecl RdrName -> RnM (DerivDecl Name, FreeVars)
 
 \begin{code}
 rnSrcDerivDecl :: DerivDecl RdrName -> RnM (DerivDecl Name, FreeVars)
-rnSrcDerivDecl (DerivDecl ty n)
+rnSrcDerivDecl (DerivDecl ty)
   = do ty' <- rnLHsType (text "a deriving decl") ty
   = do ty' <- rnLHsType (text "a deriving decl") ty
-       n'  <- lookupLocatedOccRn n
-       let fvs = extractHsTyNames ty' `addOneFV` unLoc n'
-       return (DerivDecl ty' n', fvs)
+       let fvs = extractHsTyNames ty'
+       return (DerivDecl ty', fvs)
 \end{code}
 
 %*********************************************************
 \end{code}
 
 %*********************************************************
@@ -831,8 +830,7 @@ rnTySig (tydecl@TyData {tcdCtxt = context, tcdLName = tycon,
       ASSERT( isNothing mb_typats ) -- won't have type patterns
       ASSERT( isNothing derivs )    -- won't have deriving
       ASSERT( isJust sig )          -- will have kind signature
       ASSERT( isNothing mb_typats ) -- won't have type patterns
       ASSERT( isNothing derivs )    -- won't have deriving
       ASSERT( isJust sig )          -- will have kind signature
-      do { checkM (not . null $ tyvars) $ addErr needOneIdx   -- #indexes >= 1
-        ; bindIdxVars (ksig_doc tycon) tyvars $ \tyvars' -> do {
+      do { bindIdxVars (ksig_doc tycon) tyvars $ \tyvars' -> do {
         ; tycon' <- lookupLocatedTopBndrRn tycon
         ; context' <- rnContext (ksig_doc tycon) context
         ; returnM (TyData {tcdND = tcdND tydecl, tcdCtxt = context', 
         ; tycon' <- lookupLocatedTopBndrRn tycon
         ; context' <- rnContext (ksig_doc tycon) context
         ; returnM (TyData {tcdND = tcdND tydecl, tcdCtxt = context',