Disallow standalone deriving declarations involving unboxed tuples or sums
authorRyan Scott <ryan.gl.scott@gmail.com>
Sat, 1 Oct 2016 21:58:44 +0000 (17:58 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sun, 2 Oct 2016 00:01:29 +0000 (20:01 -0400)
commit23cf32da76fe6ed29fa141047749d390df763f94
tree76966da97a5f206549161c77b3f7ae1e8cf1ab8e
parentf547b444fdaf1c86abede42bf4c4b1037f50f588
Disallow standalone deriving declarations involving unboxed tuples or sums

There was an awful leak where GHC permitted standalone `deriving`
declarations to create instances for unboxed sum or tuple types. This
fortifies the checks that GHC performs to catch this scenario and give
an appropriate error message.

Fixes #11509.

Test Plan: ./validate

Reviewers: goldfire, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

GHC Trac Issues: #11509
compiler/typecheck/TcDeriv.hs
testsuite/tests/deriving/should_fail/T12512.hs [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T12512.stderr [new file with mode: 0644]
testsuite/tests/deriving/should_fail/all.T