[commit: ghc] master: Suppress unused warnings for selectors for some derived classes (15fcd9a)
git at git.haskell.org
git at git.haskell.org
Tue Jul 11 17:42:44 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/15fcd9adb75b95b32fbe08d066a2ada5f298d667/ghc
>---------------------------------------------------------------
commit 15fcd9adb75b95b32fbe08d066a2ada5f298d667
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date: Tue Jul 11 11:57:05 2017 -0400
Suppress unused warnings for selectors for some derived classes
Although derived `Read`, `Show`, and `Generic` instances technically
don't //use// the record selectors of the data type for which an
instance is being derived, the derived code is affected by the
//presence// of record selectors. As a result, we should suppress
`-Wunused-binds` for those record selectors when deriving these classes.
This is accomplished by threading through more information from
`hasStockDeriving`.
Test Plan: make test TEST=T13919
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie
GHC Trac Issues: #13919
Differential Revision: https://phabricator.haskell.org/D3704
>---------------------------------------------------------------
15fcd9adb75b95b32fbe08d066a2ada5f298d667
compiler/typecheck/TcDeriv.hs | 39 ++++-----
compiler/typecheck/TcDerivUtils.hs | 92 +++++++++++++++++-----
testsuite/tests/deriving/should_compile/T13919.hs | 13 +++
.../tests/deriving/should_compile/T13919.stderr | 4 +-
testsuite/tests/deriving/should_compile/all.T | 1 +
5 files changed, 110 insertions(+), 39 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 15fcd9adb75b95b32fbe08d066a2ada5f298d667
More information about the ghc-commits
mailing list