summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/TyCl/Instance.hs
diff options
context:
space:
mode:
authorTorsten Schmits <git@tryp.io>2023-03-24 19:03:30 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-04-01 09:43:12 -0400
commita84fba6eb5cae43bd79cc1b26eadd7a2aa36099b (patch)
treecee09fd93bc60ba97ac8b873ce96c6ec63ccccca /compiler/GHC/Tc/TyCl/Instance.hs
parent3b5be05ac29e2ec033e108e15f052f2a13898f24 (diff)
downloadhaskell-a84fba6eb5cae43bd79cc1b26eadd7a2aa36099b.tar.gz
Add structured error messages for GHC.Tc.TyCl
Tracking ticket: #20117 MR: !10183 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
Diffstat (limited to 'compiler/GHC/Tc/TyCl/Instance.hs')
-rw-r--r--compiler/GHC/Tc/TyCl/Instance.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/GHC/Tc/TyCl/Instance.hs b/compiler/GHC/Tc/TyCl/Instance.hs
index bf710f0fe9..caae46ce36 100644
--- a/compiler/GHC/Tc/TyCl/Instance.hs
+++ b/compiler/GHC/Tc/TyCl/Instance.hs
@@ -589,7 +589,7 @@ tcTyFamInstDecl mb_clsinfo (L loc decl@(TyFamInstDecl { tfid_eqn = eqn }))
; tcFamInstDeclChecks mb_clsinfo fam_tc
-- (0) Check it's an open type family
- ; checkTc (isTypeFamilyTyCon fam_tc) (wrongKindOfFamily fam_tc)
+ ; checkTc (isTypeFamilyTyCon fam_tc) (TcRnFamilyCategoryMismatch fam_tc)
; checkTc (isOpenTypeFamilyTyCon fam_tc) (TcRnNotOpenFamily fam_tc)
-- (1) do the work of verifying the synonym group
@@ -617,7 +617,7 @@ tcFamInstDeclChecks mb_clsinfo fam_tc
; traceTc "tcFamInstDecl" (ppr fam_tc)
; type_families <- xoptM LangExt.TypeFamilies
; is_boot <- tcIsHsBootOrSig -- Are we compiling an hs-boot file?
- ; checkTc type_families (TcRnBadFamInstDecl fam_tc)
+ ; checkTc type_families (TcRnTyFamsDisabled (TyFamsDisabledInstance fam_tc))
; checkTc (not is_boot) TcRnBadBootFamInstDecl
-- Check that it is a family TyCon, and that
@@ -684,7 +684,7 @@ tcDataFamInstDecl mb_clsinfo tv_skol_env
; tcFamInstDeclChecks mb_clsinfo fam_tc
-- Check that the family declaration is for the right kind
- ; checkTc (isDataFamilyTyCon fam_tc) (wrongKindOfFamily fam_tc)
+ ; checkTc (isDataFamilyTyCon fam_tc) (TcRnFamilyCategoryMismatch fam_tc)
; gadt_syntax <- dataDeclChecks fam_name hs_ctxt hs_cons
-- Do /not/ check that the number of patterns = tyConArity fam_tc
-- See [Arity of data families] in GHC.Core.FamInstEnv