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 01:40:09 +0000 (21:40 -0400)
commitc448d5513d68da7077b2b4d3adadda93120d8504
tree72854591185f7b9de68034c4f41662bc5f90f4d4
parent906ea0445deab65f4dfcba7473593db048cbacab
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

(cherry picked from commit 23cf32da76fe6ed29fa141047749d390df763f94)
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