Fix #3741, simplifying things in the process
[ghc-hetmet.git] / compiler / rename / RnTypes.lhs
index 3086b94..b739d6d 100644 (file)
@@ -159,7 +159,7 @@ rnHsType doc (HsListTy ty) = do
 
 rnHsType doc (HsKindSig ty k)
   = do { kind_sigs_ok <- doptM Opt_KindSignatures
-       ; checkM kind_sigs_ok (addErr (kindSigErr ty))
+       ; unless kind_sigs_ok (addErr (kindSigErr ty))
        ; ty' <- rnLHsType doc ty
        ; return (HsKindSig ty' k) }
 
@@ -191,6 +191,8 @@ rnHsType doc (HsDocTy ty haddock_doc) = do
     haddock_doc' <- rnLHsDoc haddock_doc
     return (HsDocTy ty' haddock_doc')
 
+rnHsType _ (HsSpliceTyOut {}) = panic "rnHsType"
+
 rnLHsTypes :: SDoc -> [LHsType RdrName]
            -> IOEnv (Env TcGblEnv TcLclEnv) [LHsType Name]
 rnLHsTypes doc tys = mapM (rnLHsType doc) tys
@@ -211,7 +213,7 @@ rnForAll doc _ [] (L _ []) (L _ ty) = rnHsType doc ty
        -- of kind *.
 
 rnForAll doc exp forall_tyvars ctxt ty
-  = bindTyVarsRn doc forall_tyvars $ \ new_tyvars -> do
+  = bindTyVarsRn forall_tyvars $ \ new_tyvars -> do
     new_ctxt <- rnContext doc ctxt
     new_ty <- rnLHsType doc ty
     return (HsForAllTy exp new_tyvars new_ctxt new_ty)
@@ -610,7 +612,7 @@ rnSplice :: HsSplice RdrName -> RnM (HsSplice Name, FreeVars)
 rnSplice (HsSplice n expr)
   = do { checkTH expr "splice"
        ; loc  <- getSrcSpanM
-       ; [n'] <- newLocalsRn [L loc n]
+       ; n' <- newLocalBndrRn (L loc n)
        ; (expr', fvs) <- rnLExpr expr
 
        -- Ugh!  See Note [Splices] above