diff options
author | RyanGlScott <ryan.gl.scott@gmail.com> | 2016-01-26 12:33:19 -0500 |
---|---|---|
committer | RyanGlScott <ryan.gl.scott@gmail.com> | 2016-01-26 12:33:33 -0500 |
commit | 6817703b31840620cca8596ca62ed70633934972 (patch) | |
tree | a3141c8727e1a7e09b97183baa69c9cbcb666828 /utils | |
parent | 6d2bdfd8d40b926d7a11d003213220022a63d9f5 (diff) | |
download | haskell-6817703b31840620cca8596ca62ed70633934972.tar.gz |
Split off -Wunused-type-variables from -Wunused-matches
Summary:
Previously, `-Wunused-matches` would fire whenever it detected unused type
variables in a type family or data family instance. This can be annoying for
users who wish to use type variable names as documentation, as being
`-Wall`-compliant would mean that they'd have to prefix many of their type
variable names with underscores, making the documentation harder to read.
To avoid this, a new warning `-Wunused-type-variables` was created that only
encompasses unused variables in family instances. `-Wunused-matches` reverts
back to its role of only warning on unused term-level pattern names. Unlike
`-Wunused-matches`, `-Wunused-type-variables` is not implied by `-Wall`.
Fixes #11451.
Test Plan: ./validate
Reviewers: goldfire, ekmett, austin, hvr, simonpj, bgamari
Reviewed By: simonpj, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1825
GHC Trac Issues: #11451
Diffstat (limited to 'utils')
-rw-r--r-- | utils/mkUserGuidePart/Options/Warnings.hs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/mkUserGuidePart/Options/Warnings.hs b/utils/mkUserGuidePart/Options/Warnings.hs index 256d01f9fa..3fa9bf087e 100644 --- a/utils/mkUserGuidePart/Options/Warnings.hs +++ b/utils/mkUserGuidePart/Options/Warnings.hs @@ -291,6 +291,18 @@ warningsOptions = , flagType = DynamicFlag , flagReverse = "-Wno-unused-matches" } + , flag { flagName = "-Wunused-foralls" + , flagDescription = "warn about type variables in user-written "++ + "``forall``\\s that are unused" + , flagType = DynamicFlag + , flagReverse = "-Wno-unused-foralls" + } + , flag { flagName = "-Wunused-type-variables" + , flagDescription = "warn about variables in type family or data "++ + "family instances that are unused" + , flagType = DynamicFlag + , flagReverse = "-Wno-unused-type-variables" + } , flag { flagName = "-Wunused-do-bind" , flagDescription = "warn about do bindings that appear to throw away values of types "++ |