X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Frename%2FRnTypes.lhs;h=7a0948ebada183ced735a7af24a33dfcbc4bbf35;hb=7b9ccfe6947e4ef514057668d6f6673c3fedc10d;hp=3de4345458f8eba2d9974f38223a3900a4164710;hpb=9b53ebc1b2da232ae682d155dbb524dc59559f59;p=ghc-hetmet.git diff --git a/compiler/rename/RnTypes.lhs b/compiler/rename/RnTypes.lhs index 3de4345..7a0948e 100644 --- a/compiler/rename/RnTypes.lhs +++ b/compiler/rename/RnTypes.lhs @@ -31,6 +31,7 @@ import NameSet import BasicTypes ( compareFixity, funTyFixity, negateFixity, Fixity(..), FixityDirection(..) ) import Outputable +import FastString #include "HsVersions.h" \end{code} @@ -129,7 +130,7 @@ rnHsType _ (HsNumTy i) | i == 1 = return (HsNumTy i) | otherwise = addErr err_msg >> return (HsNumTy i) where - err_msg = ptext SLIT("Only unit numeric type pattern is valid") + err_msg = ptext (sLit "Only unit numeric type pattern is valid") rnHsType doc (HsFunTy ty1 ty2) = do @@ -169,9 +170,8 @@ rnHsType doc (HsPredTy pred) = do pred' <- rnPred doc pred return (HsPredTy pred') -rnHsType _ (HsSpliceTy _) = do - addErr (ptext SLIT("Type splices are not yet implemented")) - failM +rnHsType _ (HsSpliceTy _) = + failWith (ptext (sLit "Type splices are not yet implemented")) rnHsType doc (HsDocTy ty haddock_doc) = do ty' <- rnLHsType doc ty @@ -489,7 +489,7 @@ checkSectionPrec direction section op arg checkErr (op_prec < arg_prec || op_prec == arg_prec && direction == assoc) (sectionPrecErr (ppr_op op_name, op_fix) - (pp_arg_op, arg_fix) section) + (pp_arg_op, arg_fix) section) \end{code} Precedence-related error messages @@ -497,19 +497,19 @@ Precedence-related error messages \begin{code} precParseErr :: (SDoc, Fixity) -> (SDoc, Fixity) -> SDoc precParseErr op1 op2 - = hang (ptext SLIT("precedence parsing error")) - 4 (hsep [ptext SLIT("cannot mix"), ppr_opfix op1, ptext SLIT("and"), + = hang (ptext (sLit "precedence parsing error")) + 4 (hsep [ptext (sLit "cannot mix"), ppr_opfix op1, ptext (sLit "and"), ppr_opfix op2, - ptext SLIT("in the same infix expression")]) + ptext (sLit "in the same infix expression")]) sectionPrecErr :: (SDoc, Fixity) -> (SDoc, Fixity) -> HsExpr RdrName -> SDoc sectionPrecErr op arg_op section - = vcat [ptext SLIT("The operator") <+> ppr_opfix op <+> ptext SLIT("of a section"), - nest 4 (ptext SLIT("must have lower precedence than the operand") <+> ppr_opfix arg_op), - nest 4 (ptext SLIT("in the section:") <+> quotes (ppr section))] + = vcat [ptext (sLit "The operator") <+> ppr_opfix op <+> ptext (sLit "of a section"), + nest 4 (ptext (sLit "must have lower precedence than the operand") <+> ppr_opfix arg_op), + nest 4 (ptext (sLit "in the section:") <+> quotes (ppr section))] pp_prefix_minus :: SDoc -pp_prefix_minus = ptext SLIT("prefix `-'") +pp_prefix_minus = ptext (sLit "prefix `-'") ppr_op :: Outputable a => a -> SDoc ppr_op op = quotes (ppr op) -- Here, op can be a Name or a (Var n), where n is a Name ppr_opfix :: (SDoc, Fixity) -> SDoc @@ -527,20 +527,20 @@ forAllWarn :: SDoc -> LHsType RdrName -> Located RdrName -> TcRnIf TcGblEnv TcLclEnv () forAllWarn doc ty (L loc tyvar) = ifOptM Opt_WarnUnusedMatches $ - addWarnAt loc (sep [ptext SLIT("The universally quantified type variable") <+> quotes (ppr tyvar), - nest 4 (ptext SLIT("does not appear in the type") <+> quotes (ppr ty))] + addWarnAt loc (sep [ptext (sLit "The universally quantified type variable") <+> quotes (ppr tyvar), + nest 4 (ptext (sLit "does not appear in the type") <+> quotes (ppr ty))] $$ doc) opTyErr :: RdrName -> HsType RdrName -> SDoc opTyErr op ty@(HsOpTy ty1 _ _) - = hang (ptext SLIT("Illegal operator") <+> quotes (ppr op) <+> ptext SLIT("in type") <+> quotes (ppr ty)) + = hang (ptext (sLit "Illegal operator") <+> quotes (ppr op) <+> ptext (sLit "in type") <+> quotes (ppr ty)) 2 extra where extra | op == dot_tv_RDR && forall_head ty1 - = ptext SLIT("Perhaps you intended to use -XRankNTypes or similar flag") + = ptext (sLit "Perhaps you intended to use -XRankNTypes or similar flag") | otherwise - = ptext SLIT("Use -XTypeOperators to allow operators in types") + = ptext (sLit "Use -XTypeOperators to allow operators in types") forall_head (L _ (HsTyVar tv)) = tv == forall_tv_RDR forall_head (L _ (HsAppTy ty _)) = forall_head ty