Fix #14692 by correcting an off-by-one error in TcGenDeriv
authorRyan Scott <ryan.gl.scott@gmail.com>
Sun, 21 Jan 2018 17:06:06 +0000 (12:06 -0500)
committerBen Gamari <ben@smart-cactus.org>
Sun, 21 Jan 2018 17:06:07 +0000 (12:06 -0500)
commit0074a08ea9dfd1416aa57a9504be73dcdf7a1e2b
treeaf5e2f5873f3ef7643caa3af4e24733bca6dba21
parent765ba657c08453615521f5cb0b2418512e606743
Fix #14692 by correcting an off-by-one error in TcGenDeriv

A silly mistake in `gen_Show_binds` was causing derived
`Show` instances for empty data types to case on the precedence
argument instead of the actual value being showed.

Test Plan: make test TEST=drv-empty-data

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14692

Differential Revision: https://phabricator.haskell.org/D4328
compiler/typecheck/TcGenDeriv.hs
testsuite/tests/deriving/should_compile/drv-empty-data.stderr