diff options
author | Richard Eisenberg <eir@cis.upenn.edu> | 2015-06-04 17:05:02 -0400 |
---|---|---|
committer | Richard Eisenberg <eir@cis.upenn.edu> | 2015-06-05 11:09:23 -0400 |
commit | 761fb7c4869a081da7320e4307dcb947b5ed95d1 (patch) | |
tree | d1d94c92bdb6a1b0afa0edc3c89e4d598252fff5 | |
parent | 7beb4771a7adb470a98ea1cde43e9f00887ac980 (diff) | |
download | haskell-761fb7c4869a081da7320e4307dcb947b5ed95d1.tar.gz |
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
-rw-r--r-- | compiler/types/FamInstEnv.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/types/FamInstEnv.hs b/compiler/types/FamInstEnv.hs index 930d05903d..9c531381d7 100644 --- a/compiler/types/FamInstEnv.hs +++ b/compiler/types/FamInstEnv.hs @@ -809,7 +809,7 @@ reduceTyFamApp_maybe envs role tc tys , FamInstMatch { fim_instance = fam_inst , fim_tys = inst_tys } : _ <- lookupFamInstEnv envs tc tys -- NB: Allow multiple matches because of compatible overlap - + = let ax = famInstAxiom fam_inst co = mkUnbranchedAxInstCo role ax inst_tys ty = pSnd (coercionKind co) @@ -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 |