mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-09-11 14:06:13 +03:00
Don't warn for unused type parameters
This commit is contained in:
parent
1d5a0f0a79
commit
75f19382b6
@ -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 }
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user