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
Showing
- compiler/typecheck/TcDeriv.hs 20 additions, 19 deletionscompiler/typecheck/TcDeriv.hs
- compiler/typecheck/TcDerivUtils.hs 73 additions, 19 deletionscompiler/typecheck/TcDerivUtils.hs
- testsuite/tests/deriving/should_compile/T13919.hs 13 additions, 0 deletionstestsuite/tests/deriving/should_compile/T13919.hs
- testsuite/tests/deriving/should_compile/T13919.stderr 3 additions, 0 deletionstestsuite/tests/deriving/should_compile/T13919.stderr
- testsuite/tests/deriving/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/deriving/should_compile/all.T
Loading
Please register or sign in to comment