[commit: ghc] ghc-7.8: Fix #9085. (105d8d1)

git at git.haskell.org git at git.haskell.org
Wed Jul 2 16:11:49 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-7.8
Link       : http://ghc.haskell.org/trac/ghc/changeset/105d8d1c65c6eb0f1c7657dc3a395ec7bfd7c13a/ghc

>---------------------------------------------------------------

commit 105d8d1c65c6eb0f1c7657dc3a395ec7bfd7c13a
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Tue Jun 10 15:25:36 2014 -0400

    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 6a1d7f9736098d47463a71323d28ece792a59e52)


>---------------------------------------------------------------

105d8d1c65c6eb0f1c7657dc3a395ec7bfd7c13a
 compiler/typecheck/TcTyClsDecls.lhs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/compiler/typecheck/TcTyClsDecls.lhs b/compiler/typecheck/TcTyClsDecls.lhs
index 817fbb3..c03af38 100644
--- a/compiler/typecheck/TcTyClsDecls.lhs
+++ b/compiler/typecheck/TcTyClsDecls.lhs
@@ -1464,8 +1464,8 @@ checkValidClosedCoAxiom (CoAxiom { co_ax_branches = branches, co_ax_tc = tc })
                -- ones and hence is inaccessible
      check_accessibility prev_branches cur_branch
        = do { when (cur_branch `isDominatedBy` prev_branches) $
-              setSrcSpan (coAxBranchSpan cur_branch) $
-              addErrTc $ inaccessibleCoAxBranch tc cur_branch
+              addWarnAt (coAxBranchSpan cur_branch) $
+              inaccessibleCoAxBranch tc cur_branch
             ; return (cur_branch : prev_branches) }
 
 checkFieldCompat :: Name -> DataCon -> DataCon -> TyVarSet
@@ -2161,7 +2161,7 @@ wrongNamesInInstGroup first cur
 
 inaccessibleCoAxBranch :: TyCon -> CoAxBranch -> SDoc
 inaccessibleCoAxBranch tc fi
-  = ptext (sLit "Inaccessible family instance equation:") $$
+  = ptext (sLit "Overlapped type family instance equation:") $$
       (pprCoAxBranch tc fi)
 
 badRoleAnnot :: Name -> Role -> Role -> SDoc



More information about the ghc-commits mailing list