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/simplCore | |
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/simplCore')
-rw-r--r-- | testsuite/tests/simplCore/should_compile/T10689a.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T10689a.hs b/testsuite/tests/simplCore/should_compile/T10689a.hs index 5b21b42db7..477d80cb14 100644 --- a/testsuite/tests/simplCore/should_compile/T10689a.hs +++ b/testsuite/tests/simplCore/should_compile/T10689a.hs @@ -76,9 +76,9 @@ type family Foldr1 (a_afe5 :: TyFun a_afdP (TyFun a_afdP a_afdP -> *) -> *) (a_afe6 :: [a_afdP]) :: a_afdP where - Foldr1 z_afe7 '[x_afe8] = x_afe8 + Foldr1 _z_afe7 '[x_afe8] = x_afe8 Foldr1 f_afe9 ((:) x_afea ((:) wild_1627448474_afeb wild_1627448476_afec)) = Apply (Apply f_afe9 x_afea) (Apply (Apply Foldr1Sym0 f_afe9) (Let1627448493XsSym4 f_afe9 x_afea wild_1627448474_afeb wild_1627448476_afec)) - Foldr1 z_afew '[] = Apply ErrorSym0 "Data.Singletons.List.foldr1: empty list" + Foldr1 _z_afew '[] = Apply ErrorSym0 "Data.Singletons.List.foldr1: empty list" sFoldr1 :: forall (x :: TyFun a_afdP (TyFun a_afdP a_afdP -> *) -> *) |