Commit 6a1d7f97 authored by eir@cis.upenn.edu's avatar eir@cis.upenn.edu
Browse files

Fix #9085.

Inaccessible equations in a closed type family now leads to a
warning, not an error. This echoes what happens at the term level.
parent 051d694f
...@@ -1466,8 +1466,8 @@ checkValidClosedCoAxiom (CoAxiom { co_ax_branches = branches, co_ax_tc = tc }) ...@@ -1466,8 +1466,8 @@ checkValidClosedCoAxiom (CoAxiom { co_ax_branches = branches, co_ax_tc = tc })
-- ones and hence is inaccessible -- ones and hence is inaccessible
check_accessibility prev_branches cur_branch check_accessibility prev_branches cur_branch
= do { when (cur_branch `isDominatedBy` prev_branches) $ = do { when (cur_branch `isDominatedBy` prev_branches) $
setSrcSpan (coAxBranchSpan cur_branch) $ addWarnAt (coAxBranchSpan cur_branch) $
addErrTc $ inaccessibleCoAxBranch tc cur_branch inaccessibleCoAxBranch tc cur_branch
; return (cur_branch : prev_branches) } ; return (cur_branch : prev_branches) }
checkFieldCompat :: Name -> DataCon -> DataCon -> TyVarSet checkFieldCompat :: Name -> DataCon -> DataCon -> TyVarSet
...@@ -2167,7 +2167,7 @@ wrongNamesInInstGroup first cur ...@@ -2167,7 +2167,7 @@ wrongNamesInInstGroup first cur
inaccessibleCoAxBranch :: TyCon -> CoAxBranch -> SDoc inaccessibleCoAxBranch :: TyCon -> CoAxBranch -> SDoc
inaccessibleCoAxBranch tc fi inaccessibleCoAxBranch tc fi
= ptext (sLit "Inaccessible family instance equation:") $$ = ptext (sLit "Overlapped type family instance equation:") $$
(pprCoAxBranch tc fi) (pprCoAxBranch tc fi)
badRoleAnnot :: Name -> Role -> Role -> SDoc badRoleAnnot :: Name -> Role -> Role -> SDoc
......
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