Improve error messages from type-checking data constructors
[ghc-hetmet.git] / compiler / typecheck / TcTyClsDecls.lhs
index c1e5816..f3abbe9 100644 (file)
@@ -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 _)
-  = tcTyVarBndrs tvs           $ \ tvs' -> do 
+  = addErrCtxt (dataConCtxt name)      $ 
+    tcTyVarBndrs tvs                   $ \ tvs' -> do 
     { ctxt' <- tcHsKindedContext ctxt
     ; checkTc (existential_ok || (null tvs && null (unLoc ctxt)))
              (badExistential name)