Fix #14114 by checking for duplicate vars on pattern synonym RHSes
authorRyan Scott <ryan.gl.scott@gmail.com>
Tue, 22 Aug 2017 13:28:49 +0000 (09:28 -0400)
committerRyan Scott <ryan.gl.scott@gmail.com>
Tue, 22 Aug 2017 13:28:49 +0000 (09:28 -0400)
commita89bb806c58d3e601b37d6f2c4ebec6514fd2776
treeb2bef8ba5b726ac2ef726ec29eee5d6b592a93b8
parent6982ee99fb97c252c3faf37faae34131fb66f67c
Fix #14114 by checking for duplicate vars on pattern synonym RHSes

Summary:
Because we weren't checking for duplicate variables on the right-hand
sides of pattern synonyms, bogus definitions like this one passed the renamer:

```lang=haskell
pattern Foo a <- (a,a)
```

Luckily, the fix is simple.

Test Plan: make test TEST=T14114

Reviewers: mpickering, austin, bgamari, simonpj

Reviewed By: simonpj

Subscribers: simonpj, rwbarton, thomie

GHC Trac Issues: #14114

Differential Revision: https://phabricator.haskell.org/D3866
compiler/rename/RnPat.hs
testsuite/tests/patsyn/should_fail/T14114.hs [new file with mode: 0644]
testsuite/tests/patsyn/should_fail/T14114.stderr [new file with mode: 0644]
testsuite/tests/patsyn/should_fail/all.T