summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_compile/all.T
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2018-01-18 11:06:42 -0500
committerBen Gamari <ben@smart-cactus.org>2018-01-18 11:06:43 -0500
commit575c009d9e4b25384ef984c09b2c54f909693e93 (patch)
tree210feb761638b515f8abf8fe3e3726550b346cbf /testsuite/tests/deriving/should_compile/all.T
parent2a78cf773cb447ac91c4a23d7e921e091e499134 (diff)
downloadhaskell-575c009d9e4b25384ef984c09b2c54f909693e93.tar.gz
Fix #14681 and #14682 with precision-aimed parentheses
It turns out that `Convert` was recklessly leaving off parentheses in two places: * Negative numeric literals * Patterns in lambda position This patch fixes it by adding three new functions, `isCompoundHsLit`, `isCompoundHsOverLit`, and `isCompoundPat`, and using them in the right places in `Convert`. While I was in town, I also sprinkled `isCompoundPat` among some `Pat`-constructing functions in `HsUtils` to help avoid the likelihood of this problem happening in other places. One of these places is in `TcGenDeriv`, and sprinkling `isCompountPat` there fixes #14682 Test Plan: make test TEST="T14681 T14682" Reviewers: alanz, goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14681, #14682 Differential Revision: https://phabricator.haskell.org/D4323
Diffstat (limited to 'testsuite/tests/deriving/should_compile/all.T')
-rw-r--r--testsuite/tests/deriving/should_compile/all.T1
1 files changed, 1 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T
index 8752bbdb73..3360c81850 100644
--- a/testsuite/tests/deriving/should_compile/all.T
+++ b/testsuite/tests/deriving/should_compile/all.T
@@ -100,3 +100,4 @@ test('T14339', normal, compile, [''])
test('T14331', normal, compile, [''])
test('T14578', normal, compile, ['-ddump-deriv -dsuppress-uniques'])
test('T14579', normal, compile, [''])
+test('T14682', normal, compile, ['-ddump-deriv -dsuppress-uniques'])