diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-06-01 23:42:10 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-06-02 00:50:44 +0100 |
commit | 11d8f84fd3237c3821c8f826716fc4c9adfccb8c (patch) | |
tree | e0158f59a9fb5062e26d1c4edb4a0ed8af3ee724 /compiler/hsSyn/HsUtils.hs | |
parent | 2f0011aca137055f139bed484302679c10238d55 (diff) | |
download | haskell-11d8f84fd3237c3821c8f826716fc4c9adfccb8c.tar.gz |
Treat pattern-synonym binders more consistently
Pattern-synonyms are in value declarations, but were being
bound by getLocalNonValBinders. This seemed odd, and indeed
staightening it out allowed me to remove a field from
TopSigCtxt.
The main changes are in RnSource.rnSrcDecls.
Nice.
Diffstat (limited to 'compiler/hsSyn/HsUtils.hs')
-rw-r--r-- | compiler/hsSyn/HsUtils.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs index b1c8036bc1..f4737e7bdb 100644 --- a/compiler/hsSyn/HsUtils.hs +++ b/compiler/hsSyn/HsUtils.hs @@ -780,10 +780,11 @@ hsForeignDeclsBinders foreign_decls | L decl_loc (ForeignImport (L _ n) _ _ _) <- foreign_decls] ------------------- -hsPatSynBinders :: LHsBindsLR idL idR -> [Located idL] +hsPatSynBinders :: HsValBinds RdrName -> [Located RdrName] -- Collect pattern-synonym binders only, not Ids -- See Note [SrcSpan for binders] -hsPatSynBinders binds = foldrBag addPatSynBndr [] binds +hsPatSynBinders (ValBindsIn binds _) = foldrBag addPatSynBndr [] binds +hsPatSynBinders _ = panic "hsPatSynBinders" addPatSynBndr :: LHsBindLR idL idR -> [Located idL] -> [Located idL] -- See Note [SrcSpan for binders] |