Fix #16411 by making dataConCannotMatch aware of (~~)
authorRyan Scott <ryan.gl.scott@gmail.com>
Sat, 9 Mar 2019 00:02:44 +0000 (19:02 -0500)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Wed, 13 Mar 2019 19:16:08 +0000 (15:16 -0400)
commit36546a43e490ea6f989e6cad369d1a251c94a42b
treef6e6b6691cd413381a9a2945552349864e8f342a
parentcb17c2da1774a2565946f43261140f2a8b328840
Fix #16411 by making dataConCannotMatch aware of (~~)

The `dataConCannotMatch` function (which powers the
`-Wpartial-fields` warning, among other things) had special reasoning
for explicit equality constraints of the form `a ~ b`, but it did
not extend that reasoning to `a ~~ b` constraints, leading to #16411.
Easily fixed.
compiler/basicTypes/DataCon.hs
testsuite/tests/typecheck/should_compile/T16411.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T