[commit: ghc] master: Fix #10488 by unwrapping type synonyms. (761fb7c)

git at git.haskell.org git at git.haskell.org
Fri Jun 5 15:09:16 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/761fb7c4869a081da7320e4307dcb947b5ed95d1/ghc

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

commit 761fb7c4869a081da7320e4307dcb947b5ed95d1
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


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

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

diff --git a/compiler/types/FamInstEnv.hs b/compiler/types/FamInstEnv.hs
index 930d059..9c53138 100644
--- a/compiler/types/FamInstEnv.hs
+++ b/compiler/types/FamInstEnv.hs
@@ -1034,6 +1034,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