Commit e2222929 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com

Fix type checker error message

See Trac #4940. We had a message
     The lambda expression `\ x -> x' has one argument one argument,
repeating the "one argument" part.  Easy fix.
parent 8287e232
......@@ -104,15 +104,15 @@ tcMatchesCase ctxt scrut_ty matches res_ty
tcMatchLambda :: MatchGroup Name -> TcRhoType -> TcM (HsWrapper, MatchGroup TcId)
tcMatchLambda match res_ty
= matchFunTys doc n_pats res_ty $ \ pat_tys rhs_ty ->
= matchFunTys herald n_pats res_ty $ \ pat_tys rhs_ty ->
tcMatches match_ctxt pat_tys rhs_ty match
where
n_pats = matchGroupArity match
doc = sep [ ptext (sLit "The lambda expression")
<+> quotes (pprSetDepth (PartWay 1) $
herald = sep [ ptext (sLit "The lambda expression")
<+> quotes (pprSetDepth (PartWay 1) $
pprMatches (LambdaExpr :: HsMatchContext Name) match),
-- The pprSetDepth makes the abstraction print briefly
ptext (sLit "has") <+> speakNOf n_pats (ptext (sLit "argument"))]
ptext (sLit "has")]
match_ctxt = MC { mc_what = LambdaExpr,
mc_body = tcBody }
\end{code}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment