Fix Trac #745: improve error recoevery for type signatures
[ghc-hetmet.git] / compiler / typecheck / TcBinds.lhs
index 1e76698..aa179b2 100644 (file)
@@ -31,8 +31,7 @@ import Coercion
 import VarEnv
 import TysPrim
 import Id
-import IdInfo
-import Var hiding (mkLocalId)
+import Var
 import Name
 import NameSet
 import NameEnv
@@ -103,7 +102,7 @@ tcHsBootSigs (ValBindsOut binds sigs)
   where
     tc_boot_sig (TypeSig (L _ name) ty)
       = do { sigma_ty <- tcHsSigType (FunSigCtxt name) ty
-           ; return (mkVanillaGlobal name sigma_ty vanillaIdInfo) }
+           ; return (mkVanillaGlobal name sigma_ty) }
         -- Notice that we make GlobalIds, not LocalIds
     tc_boot_sig s = pprPanic "tcHsBootSigs/tc_boot_sig" (ppr s)
 tcHsBootSigs groups = pprPanic "tcHsBootSigs" (ppr groups)
@@ -155,7 +154,7 @@ tcValBinds top_lvl (ValBindsOut binds sigs) thing_inside
               ; ty_sigs = filter isVanillaLSig sigs
               ; sig_fn  = mkTcSigFun ty_sigs }
 
-        ; poly_ids <- mapM tcTySig ty_sigs
+        ; poly_ids <- checkNoErrs (mapAndRecoverM tcTySig ty_sigs)
                 -- No recovery from bad signatures, because the type sigs
                 -- may bind type variables, so proceeding without them
                 -- can lead to a cascade of errors
@@ -218,7 +217,7 @@ tc_group poly_rec top_lvl sig_fn prag_fn (Recursive, binds) thing_inside
         -- group at once; an earlier one may use a later one!
     do  { traceTc (text "tc_group rec" <+> pprLHsBinds binds)
         ; (binds1,thing) <- bindLocalInsts top_lvl $
-                            go (stronglyConnComp (mkEdges sig_fn binds))
+                            go (stronglyConnCompFromEdgedVertices (mkEdges sig_fn binds))
         ; return ([(Recursive, unionManyBags binds1)], thing) }
                 -- Rec them all together
   where