projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve error messages from type-checking data constructors
[ghc-hetmet.git]
/
compiler
/
typecheck
/
TcTyClsDecls.lhs
diff --git
a/compiler/typecheck/TcTyClsDecls.lhs
b/compiler/typecheck/TcTyClsDecls.lhs
index
c1e5816
..
f3abbe9
100644
(file)
--- a/
compiler/typecheck/TcTyClsDecls.lhs
+++ b/
compiler/typecheck/TcTyClsDecls.lhs
@@
-812,7
+812,8
@@
tcConDecl :: Bool -- True <=> -funbox-strict_fields
tcConDecl unbox_strict existential_ok tycon tc_tvs -- Data types
(ConDecl name _ tvs ctxt details res_ty _)
tcConDecl unbox_strict existential_ok tycon tc_tvs -- Data types
(ConDecl name _ tvs ctxt details res_ty _)
- = tcTyVarBndrs tvs $ \ tvs' -> do
+ = addErrCtxt (dataConCtxt name) $
+ tcTyVarBndrs tvs $ \ tvs' -> do
{ ctxt' <- tcHsKindedContext ctxt
; checkTc (existential_ok || (null tvs && null (unLoc ctxt)))
(badExistential name)
{ ctxt' <- tcHsKindedContext ctxt
; checkTc (existential_ok || (null tvs && null (unLoc ctxt)))
(badExistential name)