Improve pattern synonym error messages (add `PatSynOrigin`)
authorRik Steenkamp <rik@ewps.nl>
Thu, 25 Feb 2016 18:27:54 +0000 (19:27 +0100)
committerBen Gamari <ben@smart-cactus.org>
Thu, 25 Feb 2016 18:28:06 +0000 (19:28 +0100)
commit116528c8429257a0ae855251fd266547bb23d01d
tree4b018f7f64873d5b2b9458a6043a682af729bde3
parent20ab2adf7938bf1c6afed38509b4b01102bceff9
Improve pattern synonym error messages (add `PatSynOrigin`)

Adds a new data constructor `PatSynOrigin Bool Name` to the `CtOrigin`
data type. This allows for better error messages when the origin of a
wanted constraint is a pattern synonym declaration.

Fixes T10873.

Reviewers: mpickering, simonpj, austin, thomie, bgamari

Reviewed By: simonpj, thomie, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1866

GHC Trac Issues: #10873
compiler/typecheck/TcErrors.hs
compiler/typecheck/TcPatSyn.hs
compiler/typecheck/TcRnTypes.hs
testsuite/tests/patsyn/should_fail/T10873.hs [new file with mode: 0644]
testsuite/tests/patsyn/should_fail/T10873.stderr [new file with mode: 0644]
testsuite/tests/patsyn/should_fail/all.T