[commit: ghc] ghc-7.10: Fix #10488 by unwrapping type synonyms. (b901f0f)

git at git.haskell.org git at git.haskell.org
Tue Jun 9 02:48:51 UTC 2015


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

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/b901f0f6cd3032707b53af4d2fe8e856e015cf2c/ghc

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

commit b901f0f6cd3032707b53af4d2fe8e856e015cf2c
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Thu Jun 4 17:05:02 2015 -0400

    Fix #10488 by unwrapping type synonyms.
    
    Summary:
    Previously, I had forgotten to unwrap vanilla type synonyms in the
    "flattener" that is used around the closed-type-family apartness
    check.
    
    Test Plan: validate
    
    Reviewers: austin
    
    Subscribers: bgamari, thomie
    
    Differential Revision: https://phabricator.haskell.org/D955
    
    GHC Trac Issues: #10488
    
    (cherry picked from commit 761fb7c4869a081da7320e4307dcb947b5ed95d1)


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

b901f0f6cd3032707b53af4d2fe8e856e015cf2c
 compiler/types/FamInstEnv.hs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/compiler/types/FamInstEnv.hs b/compiler/types/FamInstEnv.hs
index a8ddda3..808dece 100644
--- a/compiler/types/FamInstEnv.hs
+++ b/compiler/types/FamInstEnv.hs
@@ -1013,6 +1013,8 @@ coreFlattenTys in_scope = go []
 coreFlattenTy :: InScopeSet -> FlattenMap -> Type -> (FlattenMap, Type)
 coreFlattenTy in_scope = go
   where
+    go m ty | Just ty' <- coreView ty = go m ty'
+
     go m ty@(TyVarTy {}) = (m, ty)
     go m (AppTy ty1 ty2) = let (m1, ty1') = go m  ty1
                                (m2, ty2') = go m1 ty2 in



More information about the ghc-commits mailing list