diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2016-10-01 17:55:26 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-10-01 20:01:29 -0400 |
commit | 1851349acd9e73f1c18d68f70d5cf7b46a843cb5 (patch) | |
tree | b61033677bd91a7dbcc8d55326f9a25c297cf79c /compiler/hsSyn | |
parent | 2d6642bd1956edf8b842c07d78e83c500246998a (diff) | |
download | haskell-1851349acd9e73f1c18d68f70d5cf7b46a843cb5.tar.gz |
Don't warn about name shadowing when renaming the patten in a PatSyn decl
Previously the renamer assumed that *any* time we renamed a pattern, the
pattern was introducing new binders. This isn't true in pattern synonym
declarations where the pattern is used as part of a definition.
We add a special case to not warn in this situation.
Reviewers: simonpj, austin, bgamari
Reviewed By: simonpj
Subscribers: simonpj, thomie
Differential Revision: https://phabricator.haskell.org/D2545
GHC Trac Issues: #12615
Diffstat (limited to 'compiler/hsSyn')
-rw-r--r-- | compiler/hsSyn/HsExpr.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs index 1ff204bd82..fdce60a172 100644 --- a/compiler/hsSyn/HsExpr.hs +++ b/compiler/hsSyn/HsExpr.hs @@ -2277,6 +2277,12 @@ data HsMatchContext id deriving Functor deriving instance (DataIdPost id) => Data (HsMatchContext id) +isPatSynCtxt :: HsMatchContext id -> Bool +isPatSynCtxt ctxt = + case ctxt of + PatSyn -> True + _ -> False + -- | Haskell Statement Context data HsStmtContext id = ListComp |