diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2022-12-02 21:30:10 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-12-03 04:39:22 -0500 |
commit | c189b831c74a550ddb3b94cf9b9f8922856b6990 (patch) | |
tree | 4189635ce87191446f99a6d2c8b8e0d67c01a96a | |
parent | 5d267d4683c2733dee7621e480c5e70ed47a4592 (diff) | |
download | haskell-c189b831c74a550ddb3b94cf9b9f8922856b6990.tar.gz |
addHsOuterFamEqnTyVarBinds: use FreshNamesOnly for explicit binders
Consider this example:
[d| instance forall a. C [a] where
type forall b. G [a] b = Proxy b |]
When we process "forall b." in the associated type instance, it is
unambiguously the binding site for "b" and we want a fresh name for it.
Therefore, FreshNamesOnly is more fitting than ReuseBoundNames.
This should not have any observable effect but it avoids pointless
lookups in the MetaEnv.
-rw-r--r-- | compiler/GHC/HsToCore/Quote.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/HsToCore/Quote.hs b/compiler/GHC/HsToCore/Quote.hs index 802ba84bb3..27dd193499 100644 --- a/compiler/GHC/HsToCore/Quote.hs +++ b/compiler/GHC/HsToCore/Quote.hs @@ -1189,7 +1189,7 @@ addHsOuterFamEqnTyVarBinds outer_bndrs thing_inside = do addSimpleTyVarBinds ReuseBoundNames imp_tvs $ thing_inside $ coreNothingList elt_ty HsOuterExplicit{hso_bndrs = exp_bndrs} -> - addHsTyVarBinds ReuseBoundNames exp_bndrs $ \th_exp_bndrs -> + addHsTyVarBinds FreshNamesOnly exp_bndrs $ \th_exp_bndrs -> thing_inside $ coreJustList elt_ty th_exp_bndrs addHsOuterSigTyVarBinds :: |