Don't warn about name shadowing when renaming the patten in a PatSyn decl
authorMatthew Pickering <matthewtpickering@gmail.com>
Sat, 1 Oct 2016 21:55:26 +0000 (17:55 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sun, 2 Oct 2016 00:01:29 +0000 (20:01 -0400)
commit1851349acd9e73f1c18d68f70d5cf7b46a843cb5
treeb61033677bd91a7dbcc8d55326f9a25c297cf79c
parent2d6642bd1956edf8b842c07d78e83c500246998a
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
compiler/hsSyn/HsExpr.hs
compiler/rename/RnPat.hs
testsuite/tests/patsyn/should_compile/T12615.hs [new file with mode: 0644]
testsuite/tests/patsyn/should_compile/all.T