Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : ghc-defer
http://hackage.haskell.org/trac/ghc/changeset/979221cf80ae998e5546074340ef01308b61da6b >--------------------------------------------------------------- commit 979221cf80ae998e5546074340ef01308b61da6b Merge: e7c534a... e1a8d3f... Author: Jose Pedro Magalhaes <[email protected]> Date: Thu Dec 22 14:22:51 2011 +0000 Merge branch 'master' into ghc-defer Conflicts: compiler/typecheck/TcErrors.lhs compiler/typecheck/TcEvidence.lhs compiler/deSugar/DsBinds.lhs | 4 +- compiler/typecheck/TcCanonical.lhs | 230 ++++++++++++------------------------ compiler/typecheck/TcErrors.lhs | 12 ++- compiler/typecheck/TcEvidence.lhs | 47 ++++++-- compiler/typecheck/TcHsSyn.lhs | 39 +++++-- compiler/typecheck/TcInteract.lhs | 138 +++++++++++++++++++-- compiler/typecheck/TcRnMonad.lhs | 11 ++- compiler/typecheck/TcRnTypes.lhs | 5 + compiler/typecheck/TcSMonad.lhs | 94 ++------------- compiler/types/TypeRep.lhs | 2 +- sync-all | 106 ++++++++++------- 11 files changed, 362 insertions(+), 326 deletions(-) diff --cc compiler/typecheck/TcErrors.lhs index b803edb,8e86afc..f2bdf2f --- a/compiler/typecheck/TcErrors.lhs +++ b/compiler/typecheck/TcErrors.lhs @@@ -24,8 -23,9 +24,9 @@@ import TcSMona import TcType import TypeRep import Type + import Kind ( isKind ) import Class -import Unify ( tcMatchTys ) +import Unify ( tcMatchTys ) import Inst import InstEnv import TyCon @@@ -543,10 -465,13 +544,13 @@@ addExtraInfo ctxt ty1 ty extra1 = typeExtraInfoMsg (cec_encl ctxt) ty1 extra2 = typeExtraInfoMsg (cec_encl ctxt) ty2 - misMatchMsg :: TcType -> TcType -> SDoc - misMatchMsg ty_act ty_exp - = sep [ ptext (sLit "Couldn't match expected type") <+> quotes (ppr ty_exp) - , nest 12 $ ptext (sLit "with actual type") <+> quotes (ppr ty_act)] + misMatchMsg :: TcType -> TcType -> SDoc -- Types are already tidy + misMatchMsg ty1 ty2 + = sep [ ptext cm_ty_or_knd <+> quotes (ppr ty1) - , nest 15 $ ptext (sLit "with") <+> quotes (ppr ty2)] ++ , nest 15 $ ptext (sLit "with actual") <+> quotes (ppr ty2)] + where cm_ty_or_knd - | isKind ty1 = sLit "Couldn't match kind" - | otherwise = sLit "Couldn't match type" ++ | isKind ty1 = sLit "Couldn't match expected kind" ++ | otherwise = sLit "Couldn't match expected type" kindErrorMsg :: TcType -> TcType -> SDoc -- Types are already tidy kindErrorMsg ty1 ty2 diff --cc compiler/typecheck/TcEvidence.lhs index acd8ffd,87aaa32..aa1489a --- a/compiler/typecheck/TcEvidence.lhs +++ b/compiler/typecheck/TcEvidence.lhs @@@ -447,28 -447,25 +447,29 @@@ evBindMapBinds b data EvBind = EvBind EvVar EvTerm data EvTerm - = EvId EvId -- Term-level variable-to-variable bindings - -- (no coercion variables! they come via EvCoercion) + = EvId EvId -- Term-level variable-to-variable bindings + -- (no coercion variables! they come via EvCoercion) - | EvCoercion TcCoercion -- (Boxed) coercion bindings + | EvCoercion TcCoercion -- (Boxed) coercion bindings - | EvCast EvVar TcCoercion -- d |> co + | EvCast EvVar TcCoercion -- d |> co - | EvDFunApp DFunId -- Dictionary instance application + | EvDFunApp DFunId -- Dictionary instance application [Type] [EvVar] - | EvTupleSel EvId Int -- n'th component of the tuple + | EvTupleSel EvId Int -- n'th component of the tuple - | EvTupleMk [EvId] -- tuple built from this stuff + | EvTupleMk [EvId] -- tuple built from this stuff - | EvSuperClass DictId Int -- n'th superclass. Used for both equalities and - -- dictionaries, even though the former have no - -- selector Id. We count up from _0_ - + | EvDelayedError Type FastString -- Used with Opt_WarnTypeErrors + -- See Note [Deferring coercion errors to runtime] + -- in TcSimplify + + | EvSuperClass DictId Int -- n'th superclass. Used for both equalities and + -- dictionaries, even though the former have no + -- selector Id. We count up from _0_ + | EvKindCast EvVar TcCoercion -- See Note [EvKindCast] + deriving( Data.Data, Data.Typeable) \end{code} @@@ -506,13 -523,13 +527,14 @@@ isEmptyTcEvBinds (TcEvBinds {}) = pani evVarsOfTerm :: EvTerm -> [EvVar] evVarsOfTerm (EvId v) = [v] -evVarsOfTerm (EvCoercion co) = varSetElems (coVarsOfTcCo co) -evVarsOfTerm (EvDFunApp _ _ evs) = evs -evVarsOfTerm (EvTupleSel v _) = [v] -evVarsOfTerm (EvSuperClass v _) = [v] -evVarsOfTerm (EvCast v co) = v : varSetElems (coVarsOfTcCo co) -evVarsOfTerm (EvTupleMk evs) = evs +evVarsOfTerm (EvCoercion co) = varSetElems (coVarsOfTcCo co) +evVarsOfTerm (EvDFunApp _ _ evs) = evs +evVarsOfTerm (EvTupleSel v _) = [v] +evVarsOfTerm (EvSuperClass v _) = [v] +evVarsOfTerm (EvCast v co) = v : varSetElems (coVarsOfTcCo co) +evVarsOfTerm (EvTupleMk evs) = evs +evVarsOfTerm (EvDelayedError _ _) = [] + evVarsOfTerm (EvKindCast v co) = v : varSetElems (coVarsOfTcCo co) \end{code} _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
