diff options
Diffstat (limited to 'compiler/GHC/Tc')
-rw-r--r-- | compiler/GHC/Tc/Errors/Hole.hs | 11 | ||||
-rw-r--r-- | compiler/GHC/Tc/Gen/Sig.hs | 3 | ||||
-rw-r--r-- | compiler/GHC/Tc/Instance/Typeable.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Tc/TyCl/PatSyn.hs | 4 | ||||
-rw-r--r-- | compiler/GHC/Tc/Utils/Monad.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Tc/Validity.hs | 3 |
6 files changed, 14 insertions, 11 deletions
diff --git a/compiler/GHC/Tc/Errors/Hole.hs b/compiler/GHC/Tc/Errors/Hole.hs index 8ec874da41..5590e29454 100644 --- a/compiler/GHC/Tc/Errors/Hole.hs +++ b/compiler/GHC/Tc/Errors/Hole.hs @@ -82,7 +82,7 @@ import GHC.Builtin.Utils (knownKeyNames) import GHC.Tc.Errors.Hole.FitTypes import qualified Data.Set as Set import GHC.Types.SrcLoc -import GHC.Data.FastString (unpackFS) +import GHC.Data.FastString (NonDetFastString(..)) import GHC.Types.Unique.Map @@ -482,15 +482,16 @@ addHoleFitDocs fits = Just m -> Right m Nothing -> Left $ case nameSrcLoc name of - RealSrcLoc r _ -> unpackFS $ srcLocFile r - UnhelpfulLoc s -> unpackFS $ s + -- Nondeterminism is fine, this is used only to display a warning + RealSrcLoc r _ -> NonDetFastString $ srcLocFile r + UnhelpfulLoc s -> NonDetFastString s report mods = do { let warning = text "WARNING: Couldn't find any documentation for the following modules:" $+$ nest 2 - (pprWithCommas (either text ppr) (Set.toList mods) $+$ + (pprWithCommas (either ppr ppr) (Set.toList mods) $+$ text "Make sure the modules are compiled with '-haddock'.") - ; warnPprTrace (not $ Set.null mods)"addHoleFitDocs" warning (pure ()) + ; warnPprTrace (not $ Set.null mods) "addHoleFitDocs" warning (pure ()) } -- For pretty printing hole fits, we display the name and type of the fit, diff --git a/compiler/GHC/Tc/Gen/Sig.hs b/compiler/GHC/Tc/Gen/Sig.hs index cfc5454e54..6b141d9173 100644 --- a/compiler/GHC/Tc/Gen/Sig.hs +++ b/compiler/GHC/Tc/Gen/Sig.hs @@ -26,6 +26,7 @@ module GHC.Tc.Gen.Sig( ) where import GHC.Prelude +import GHC.Data.FastString import GHC.Driver.Session import GHC.Driver.Backend @@ -246,7 +247,7 @@ tcUserTypeSig loc hs_sig_ty mb_name where name = case mb_name of Just n -> n - Nothing -> mkUnboundName (mkVarOcc "<expression>") + Nothing -> mkUnboundName (mkVarOccFS (fsLit "<expression>")) ctxt_rrc = ctxt_fn (lhsSigWcTypeContextSpan hs_sig_ty) ctxt_no_rrc = ctxt_fn NoRRC diff --git a/compiler/GHC/Tc/Instance/Typeable.hs b/compiler/GHC/Tc/Instance/Typeable.hs index 3c5343722e..e0bcfa8428 100644 --- a/compiler/GHC/Tc/Instance/Typeable.hs +++ b/compiler/GHC/Tc/Instance/Typeable.hs @@ -190,7 +190,7 @@ mkModIdBindings :: TcM TcGblEnv mkModIdBindings = do { mod <- getModule ; loc <- getSrcSpanM - ; mod_nm <- newGlobalBinder mod (mkVarOcc "$trModule") loc + ; mod_nm <- newGlobalBinder mod (mkVarOccFS (fsLit "$trModule")) loc ; trModuleTyCon <- tcLookupTyCon trModuleTyConName ; let mod_id = mkExportedVanillaId mod_nm (mkTyConApp trModuleTyCon []) ; mod_bind <- mkVarBind mod_id <$> mkModIdRHS mod diff --git a/compiler/GHC/Tc/TyCl/PatSyn.hs b/compiler/GHC/Tc/TyCl/PatSyn.hs index 2e9b3c1809..a448d550ac 100644 --- a/compiler/GHC/Tc/TyCl/PatSyn.hs +++ b/compiler/GHC/Tc/TyCl/PatSyn.hs @@ -787,8 +787,8 @@ tcPatSynMatcher (L loc ps_name) lpat prag_fn (ex_tvs, ex_tys, prov_theta, prov_dicts) (args, arg_tys) pat_ty = do { let loc' = locA loc - ; rr_name <- newNameAt (mkTyVarOcc "rep") loc' - ; tv_name <- newNameAt (mkTyVarOcc "r") loc' + ; rr_name <- newNameAt (mkTyVarOccFS (fsLit "rep")) loc' + ; tv_name <- newNameAt (mkTyVarOccFS (fsLit "r")) loc' ; let rr_tv = mkTyVar rr_name runtimeRepTy rr = mkTyVarTy rr_tv res_tv = mkTyVar tv_name (mkTYPEapp rr) diff --git a/compiler/GHC/Tc/Utils/Monad.hs b/compiler/GHC/Tc/Utils/Monad.hs index 8319212147..2f61ff8777 100644 --- a/compiler/GHC/Tc/Utils/Monad.hs +++ b/compiler/GHC/Tc/Utils/Monad.hs @@ -1921,7 +1921,7 @@ emitAnonTypeHole extra_constraints tv , hole_loc = ct_loc } ; emitHole hole } where - occ = mkTyVarOcc "_" + occ = mkTyVarOccFS (fsLit "_") sort | YesExtraConstraint <- extra_constraints = ConstraintHole | otherwise = TypeHole diff --git a/compiler/GHC/Tc/Validity.hs b/compiler/GHC/Tc/Validity.hs index 4dc4161664..97f9a8384f 100644 --- a/compiler/GHC/Tc/Validity.hs +++ b/compiler/GHC/Tc/Validity.hs @@ -21,6 +21,7 @@ module GHC.Tc.Validity ( ) where import GHC.Prelude +import GHC.Data.FastString import GHC.Data.Maybe @@ -2274,7 +2275,7 @@ checkConsistentFamInst (InClsInst { ai_class = clas tidyTypes tidy_env2 ax_arg_tys mk_wildcard at_tv = mkTyVarTy (mkTyVar tv_name (tyVarKind at_tv)) - tv_name = mkInternalName (mkAlphaTyVarUnique 1) (mkTyVarOcc "_") noSrcSpan + tv_name = mkInternalName (mkAlphaTyVarUnique 1) (mkTyVarOccFS (fsLit "_")) noSrcSpan -- For check_match, bind_me, see -- Note [Matching in the consistent-instantiation check] |