Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
5463bfd3
Commit
5463bfd3
authored
May 28, 2009
by
simonpj@microsoft.com
Browse files
Adjust error message slightly
parent
5cc715b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/typecheck/TcTyFuns.lhs
View file @
5463bfd3
...
...
@@ -1610,10 +1610,10 @@ misMatchMsg env0 (ty_act, ty_exp)
open_tcs = [tc | TyConApp tc _ <- [ty_act, ty_exp]
, isOpenTyCon tc ]
pp_open_tc tc = ptext (sLit "NB:") <+> quotes (ppr tc)
<+>
pp_inj <+>
ptext (sLit "type function")
where
pp_inj | isInjectiveTyCon tc =
ptext (sLit "is an (injective)")
| otherwise
= ptext (sLit
"is a (non-
injective
)
")
<+> ptext (sLit "
is a
type function")
<> pp_inj
where
pp_inj | isInjectiveTyCon tc =
empty
| otherwise = ptext (sLit
(", and may not be
injective")
)
ppr_ty :: TidyEnv -> TcType -> (TidyEnv, SDoc, SDoc)
ppr_ty env ty
...
...
@@ -1639,7 +1639,7 @@ It's very confusing to get a message like
Couldn't match expected type `Depend s'
against inferred type `Depend s1'
so pp_open_tc adds:
NB: `Depend' is
a (non-injective) type fun
cti
on
NB: `Depend' is
type function, and hence may not be inje
cti
ve
Currently we add this independently for each argument, so we also get
Couldn't match expected type `a'
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment