Skip to content
Snippets Groups Projects
Commit 105d8d1c authored by Richard Eisenberg's avatar Richard Eisenberg Committed by Austin Seipp
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.

(cherry picked from commit 6a1d7f97)
parent 291681ad
No related tags found
No related merge requests found
...@@ -1464,8 +1464,8 @@ checkValidClosedCoAxiom (CoAxiom { co_ax_branches = branches, co_ax_tc = tc }) ...@@ -1464,8 +1464,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
...@@ -2161,7 +2161,7 @@ wrongNamesInInstGroup first cur ...@@ -2161,7 +2161,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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment