Don't warn for unused type parameters

This commit is contained in:
Iavor Diatchki 2022-06-09 14:20:23 -07:00
parent 1d5a0f0a79
commit 75f19382b6
2 changed files with 6 additions and 6 deletions

View File

@ -663,11 +663,11 @@ instance Rename ModParam where
depsOf (ModParamName (srcRange (mpSignature mp)) (mpName mp))
do ren <- renModParamInstance <$> getModParam (mpName mp)
{- Here we add a single "use" to all type-level names intorduced,
because this is their binding site. The warnings for unused names
are reported for names with a single "use" (i.e., the binding site)
so if we don't add the bindg site use, we get incorrect warnings -}
mapM_ recordUse [ t | t <- Map.keys ren, nameNamespace t == NSType ]
{- Here we add 2 "uses" to all type-level names intorduced,
so that we don't get unused warnings for type parameters.
-}
mapM_ recordUse [ s | t <- Map.keys ren, nameNamespace t == NSType
, s <- [t,t] ]
pure mp { mpSignature = x, mpRenaming = ren }

View File

@ -25,7 +25,7 @@ import Prelude.Compat
import Cryptol.Utils.PP(pp)
import Cryptol.Utils.Panic(panic)
import Cryptol.Utils.Ident(modPathCommon,OrigName(..),topModuleFor)
import Cryptol.Utils.Ident(modPathCommon,OrigName(..))
import Cryptol.ModuleSystem.Name
import Cryptol.ModuleSystem.NamingEnv
import Cryptol.ModuleSystem.Binds