[commit: ghc] wip/rwbarton-dep-finsts: Check local family instances against all family instance module dependencies (608cad5)

git at git.haskell.org git at git.haskell.org
Tue Jan 10 13:52:42 UTC 2017


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

On branch  : wip/rwbarton-dep-finsts
Link       : http://ghc.haskell.org/trac/ghc/changeset/608cad595c033ba89e757c8f61a9b791a7085367/ghc

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

commit 608cad595c033ba89e757c8f61a9b791a7085367
Author: Reid Barton <rwbarton at gmail.com>
Date:   Tue Jan 10 08:32:57 2017 -0500

    Check local family instances against all family instance module dependencies


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

608cad595c033ba89e757c8f61a9b791a7085367
 compiler/typecheck/FamInst.hs | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/compiler/typecheck/FamInst.hs b/compiler/typecheck/FamInst.hs
index 0dd385d..98adbce 100644
--- a/compiler/typecheck/FamInst.hs
+++ b/compiler/typecheck/FamInst.hs
@@ -415,8 +415,14 @@ tcTopNormaliseNewTypeTF_maybe faminsts rdr_env ty
 
 -- Add new locally-defined family instances
 tcExtendLocalFamInstEnv :: [FamInst] -> TcM a -> TcM a
+tcExtendLocalFamInstEnv [] thing_inside = thing_inside
 tcExtendLocalFamInstEnv fam_insts thing_inside
- = do { env <- getGblEnv
+ = do { env0 <- getGblEnv
+      ; let this_mod = tcg_mod env0
+            imports = tcg_imports env0
+      ; loadModuleInterfaces (text "Loading family-instance modules")
+                             (filter (/= this_mod) (imp_finsts imports))
+      ; env <- getGblEnv
       ; (inst_env', fam_insts') <- foldlM addLocalFamInst
                                        (tcg_fam_inst_env env, tcg_fam_insts env)
                                        fam_insts



More information about the ghc-commits mailing list