Fix #14135 by validity checking matches
authorCarlos Tomé <carlostome1990@gmail.com>
Mon, 11 Dec 2017 20:38:03 +0000 (15:38 -0500)
committerBen Gamari <ben@smart-cactus.org>
Thu, 14 Dec 2017 17:49:08 +0000 (12:49 -0500)
commit16c7d9dc9ea7505256e0792c958cab8ae7c8a5c4
treea552f4a0a4be5bb2980af65cbab1cf8bc09e30f5
parenteeb36ebdfd1361e18a57609dda6524ddd24cdd8d
Fix #14135 by validity checking matches

We filter the complete patterns given in a COMPLETE set to only those that
subsume the type we are matching. Otherwise we end up introducing an ill-typed
equation into the overlap checking, provoking a crash. This was the cause of
Trac #14135.

Reviewers: austin, bgamari, mpickering, gkaracha, simonpj, RyanGlScott,
carlostome

Reviewed By: bgamari

Subscribers: carter, dfeuer, RyanGlScott, goldfire, rwbarton, thomie

GHC Trac Issues: #14135

Differential Revision: https://phabricator.haskell.org/D3981
compiler/deSugar/Check.hs
testsuite/tests/deSugar/should_compile/T14135.hs [new file with mode: 0644]
testsuite/tests/deSugar/should_compile/T14135.stderr [new file with mode: 0644]
testsuite/tests/deSugar/should_compile/all.T