diff options
author | Michał Sośnicki <sosnicki.michal@gmail.com> | 2015-12-21 12:29:03 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-12-21 12:29:15 +0100 |
commit | eb7796f13e701cce4e7d1d86f36c966aa17f1e9c (patch) | |
tree | dae79155de652bcc9e09b34ad91c44273d860d28 /testsuite/tests/partial-sigs/should_fail/WildcardInADTContext2.stderr | |
parent | b225b234a6b11e42fef433dcd5d2a38bb4b466bf (diff) | |
download | haskell-eb7796f13e701cce4e7d1d86f36c966aa17f1e9c.tar.gz |
Warn about unused type variables in type families
The warnings are enabled with the flag -fwarn-unused-matches, the same
one that enables warnings on the term level.
Identifiers starting with an underscore are now always parsed as type
variables. When the NamedWildCards extension is enabled, the renamer
replaces those variables with named wildcards.
An additional NameSet nwcs is added to LocalRdrEnv. It's used to keep
names of the type variables that should be replaced with wildcards.
While renaming HsForAllTy, when a name is explicitly bound it is removed
from the nwcs NameSet. As a result, the renamer doesn't replace them in
the quantifier body. (Trac #11098)
Fixes #10982, #11098
Reviewers: alanz, bgamari, hvr, austin, jstolarek
Reviewed By: jstolarek
Subscribers: goldfire, mpickering, RyanGlScott, thomie
Differential Revision: https://phabricator.haskell.org/D1576
GHC Trac Issues: #10982
Diffstat (limited to 'testsuite/tests/partial-sigs/should_fail/WildcardInADTContext2.stderr')
-rw-r--r-- | testsuite/tests/partial-sigs/should_fail/WildcardInADTContext2.stderr | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInADTContext2.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInADTContext2.stderr index ea145785e6..efa5707692 100644 --- a/testsuite/tests/partial-sigs/should_fail/WildcardInADTContext2.stderr +++ b/testsuite/tests/partial-sigs/should_fail/WildcardInADTContext2.stderr @@ -3,5 +3,5 @@ WildcardInADTContext2.hs:1:53: warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
WildcardInADTContext2.hs:4:10: error:
- Wildcard ‘_a’ not allowed
- in the data type declaration for ‘Foo’
+ Not in scope: type variable ‘_a’
+ Perhaps you meant ‘a’ (line 4)
|