Fix #13948 by being pickier about when to suggest DataKinds
authorRyan Scott <ryan.gl.scott@gmail.com>
Tue, 11 Jul 2017 17:59:07 +0000 (13:59 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 11 Jul 2017 18:34:09 +0000 (14:34 -0400)
commitba46e63f3d6f7d0438a0262f6711f8a219c703bc
tree8ccb4f26558567381ef3355d9f4073f5aba9a16e
parentea751248d80efe7633a31120da56e9a31b6820ff
Fix #13948 by being pickier about when to suggest DataKinds

Commit 343cb32d0983f576d344a2d04a35c3fd6eecf2c5 (#13568) made GHC a bit
too cavalier in suggesting when data constructors are in scope (and
suggesting the use of `DataKinds`). This tones down the suggestions so
that `DataKinds` is only suggested if a data constructor of that name is
actually in scope (previously, it would always suggest, even if it was
out of scope).

Fixes #13948.

Test Plan: ./validate

Reviewers: mpickering, austin, bgamari

Reviewed By: mpickering

Subscribers: rwbarton, thomie

GHC Trac Issues: #13948

Differential Revision: https://phabricator.haskell.org/D3719
14 files changed:
compiler/rename/RnEnv.hs
testsuite/tests/module/mod122.stderr
testsuite/tests/module/mod123.stderr
testsuite/tests/module/mod124.stderr
testsuite/tests/module/mod127.stderr
testsuite/tests/module/mod29.stderr
testsuite/tests/module/mod50.stderr
testsuite/tests/parser/should_fail/readFail001.stderr
testsuite/tests/rename/prog003/rename.prog003.stderr
testsuite/tests/rename/should_fail/T1595a.stderr
testsuite/tests/rename/should_fail/T5745.stderr
testsuite/tests/typecheck/should_fail/T1595.stderr
testsuite/tests/typecheck/should_fail/tcfail048.stderr
testsuite/tests/typecheck/should_fail/tcfail053.stderr