diff options
author | Richard Eisenberg <rae@richarde.dev> | 2021-06-01 15:32:34 -0400 |
---|---|---|
committer | Richard Eisenberg <rae@richarde.dev> | 2021-06-01 15:33:24 -0400 |
commit | ff6a88ec8bedf59295c2c154c1056b80569fe756 (patch) | |
tree | 1b19dc9bf743448fb105ac00528ab9bfbfca0459 /compiler/GHC/Tc | |
parent | 6db8a0f76ec45d47060e28bb303e9eef60bdb16b (diff) | |
download | haskell-wip/lower-parser-deps.tar.gz |
A little import wrangling. Not much accomplishedwip/lower-parser-deps
Diffstat (limited to 'compiler/GHC/Tc')
-rw-r--r-- | compiler/GHC/Tc/Module.hs | 9 | ||||
-rw-r--r-- | compiler/GHC/Tc/Types.hs | 14 |
2 files changed, 10 insertions, 13 deletions
diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs index 450e97819a..95d442e4ad 100644 --- a/compiler/GHC/Tc/Module.hs +++ b/compiler/GHC/Tc/Module.hs @@ -121,6 +121,7 @@ import GHC.Core.Unify( RoughMatchTc(..) ) import GHC.Core.FamInstEnv ( FamInst, pprFamInst, famInstsRepTyCons , famInstEnvElts, extendFamInstEnvList, normaliseType ) +import GHC.Core.Lint ( lintAxioms ) import GHC.Parser.Header ( mkPrelImports ) @@ -348,6 +349,14 @@ tcRnModuleTcRnM hsc_env mod_sum } } +-- | Check the 'TcGblEnv' for consistency. Currently, only checks +-- axioms, but should check other aspects, too. +lintGblEnv :: Logger -> DynFlags -> TcGblEnv -> TcM () +lintGblEnv logger dflags tcg_env = + liftIO $ lintAxioms logger dflags (text "TcGblEnv axioms") axioms + where + axioms = typeEnvCoAxioms (tcg_type_env tcg_env) + implicitPreludeWarn :: SDoc implicitPreludeWarn = text "Module `Prelude' implicitly imported" diff --git a/compiler/GHC/Tc/Types.hs b/compiler/GHC/Tc/Types.hs index 2d80039234..9ebb96008c 100644 --- a/compiler/GHC/Tc/Types.hs +++ b/compiler/GHC/Tc/Types.hs @@ -80,9 +80,6 @@ module GHC.Tc.Types( RoleAnnotEnv, emptyRoleAnnotEnv, mkRoleAnnotEnv, lookupRoleAnnot, getRoleAnnots, - -- Linting - lintGblEnv, - -- Diagnostics TcRnMessage ) where @@ -106,7 +103,6 @@ import GHC.Tc.Errors.Types import GHC.Core.Type import GHC.Core.TyCon ( TyCon, tyConKind ) import GHC.Core.PatSyn ( PatSyn ) -import GHC.Core.Lint ( lintAxioms ) import GHC.Core.UsageEnv import GHC.Core.InstEnv import GHC.Core.FamInstEnv @@ -1755,18 +1751,10 @@ getRoleAnnots bndrs role_env {- ********************************************************************* * * - Linting a TcGblEnv + DocLoc * * ********************************************************************* -} --- | Check the 'TcGblEnv' for consistency. Currently, only checks --- axioms, but should check other aspects, too. -lintGblEnv :: Logger -> DynFlags -> TcGblEnv -> TcM () -lintGblEnv logger dflags tcg_env = - liftIO $ lintAxioms logger dflags (text "TcGblEnv axioms") axioms - where - axioms = typeEnvCoAxioms (tcg_type_env tcg_env) - -- | This is a mirror of Template Haskell's DocLoc, but the TH names are -- resolved to GHC names. data DocLoc = DeclDoc Name |