Improve error message for newtypes and deriving clauses
authorJohn Wiegley <johnw@newartisans.com>
Thu, 30 Jul 2015 13:08:28 +0000 (15:08 +0200)
committerBen Gamari <ben@smart-cactus.org>
Thu, 30 Jul 2015 15:05:35 +0000 (17:05 +0200)
commit4f80ec0ee438800d95673a4898e69371957fed09
tree47b00b465f2e700aed1e50333c8e0f74e3a754e1
parent26315ed282db2eb1977872bbcb0b298f32b38e99
Improve error message for newtypes and deriving clauses

Summary:
Change the error message generated when a deriving clause related to a newtype
fails to always suggested trying GeneralizedNewtypeDeriving, even in
situations where it may not work. Fixes #9600.

Test Plan: testsuite/deriving/should_fail/9600.hs

Reviewers: austin, bgamari, simonpj

Rebased-by: bgamari
Reviewed By: simonpj

Subscribers: bgamari, hvr, simonmar, carter

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

GHC Trac Issues: #9600
14 files changed:
compiler/typecheck/TcDeriv.hs
testsuite/tests/deriving/should_fail/T2721.stderr
testsuite/tests/deriving/should_fail/T3833.stderr
testsuite/tests/deriving/should_fail/T3834.stderr
testsuite/tests/deriving/should_fail/T9600-1.hs [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T9600-1.stderr [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T9600.hs [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T9600.stderr [new file with mode: 0644]
testsuite/tests/deriving/should_fail/all.T
testsuite/tests/deriving/should_fail/drvfail009.stderr
testsuite/tests/generics/T5462No1.stderr
testsuite/tests/module/mod53.stderr
testsuite/tests/parser/should_fail/readFail039.stderr
testsuite/tests/safeHaskell/ghci/p16.stderr