[commit: ghc] master: Fix marshalling of IfaceAt to and from interface files (6f331d6)

git at git.haskell.org git at git.haskell.org
Wed Nov 6 08:32:01 UTC 2013


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6f331d69e50f13626b65ab76de408a49caebd4f6/ghc

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

commit 6f331d69e50f13626b65ab76de408a49caebd4f6
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Nov 5 14:58:10 2013 +0000

    Fix marshalling of IfaceAt to and from interface files
    
    I had forgotten about Note [CoAxBranch type variables] in CoAxiom
    
    This patch fixes Trac #8500


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

6f331d69e50f13626b65ab76de408a49caebd4f6
 compiler/iface/MkIface.lhs |    4 +++-
 compiler/iface/TcIface.lhs |    3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs
index a8d2ccb..b7b5448 100644
--- a/compiler/iface/MkIface.lhs
+++ b/compiler/iface/MkIface.lhs
@@ -1513,7 +1513,9 @@ coAxBranchToIfaceBranch' env0
                   , ifaxbRHS    = tidyToIfaceType env1 rhs
                   , ifaxbIncomps = [] }
   where
-    (env1, tv_bndrs) = tidyTyVarBndrs env0 tvs
+    (env1, tv_bndrs) = tidyTyClTyVarBndrs env0 tvs
+    -- Don't re-bind in-scope tyvars
+    -- See Note [CoAxBranch type variables] in CoAxiom
 
 -----------------
 tyConToIfaceDecl :: TidyEnv -> TyCon -> IfaceDecl
diff --git a/compiler/iface/TcIface.lhs b/compiler/iface/TcIface.lhs
index 867af7b..7376169 100644
--- a/compiler/iface/TcIface.lhs
+++ b/compiler/iface/TcIface.lhs
@@ -589,7 +589,8 @@ tc_ax_branch :: Kind -> [CoAxBranch] -> IfaceAxBranch -> IfL [CoAxBranch]
 tc_ax_branch tc_kind prev_branches
              (IfaceAxBranch { ifaxbTyVars = tv_bndrs, ifaxbLHS = lhs, ifaxbRHS = rhs
                             , ifaxbRoles = roles, ifaxbIncomps = incomps })
-  = bindIfaceTyVars tv_bndrs $ \ tvs -> do  -- Variables will all be fresh
+  = bindIfaceTyVars_AT tv_bndrs $ \ tvs -> do
+         -- The _AT variant is needed here; see Note [CoAxBranch type variables] in CoAxiom
     { tc_lhs <- tcIfaceTcArgs tc_kind lhs   -- See Note [Checking IfaceTypes vs IfaceKinds]
     ; tc_rhs <- tcIfaceType rhs
     ; let br = CoAxBranch { cab_loc     = noSrcSpan



More information about the ghc-commits mailing list