summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2021-11-21 18:50:40 +0100
committerKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2021-11-23 00:57:53 +0100
commitf3a62e2acda1c4b316e0a390227c90018ff2c299 (patch)
tree45b183959e81af8a62fbcfe8801eaaba0d3c610a /compiler/GHC/Tc
parent742d8b6049c30f3b0cd1704d7a34d865bef41712 (diff)
downloadhaskell-wip/misc-fix.tar.gz
Misc cleanupwip/misc-fix
* Remove `getTag_RDR` (unused), `tidyKind` and `tidyOpenKind` (already available as `tidyType` and `tidyOpenType`) * Remove Note [Explicit Case Statement for Specificity]. Since 0a709dd9876e40 we require GHC 8.10 for bootstrapping. * Change the warning to `cmpAltCon` to a panic. This shouldn't happen. If it ever does, the code was wrong anyway: it shouldn't always return `LT`, but rather `LT` in one case and `GT` in the other case. * Rename `verifyLinearConstructors` to `verifyLinearFields` * Fix `Note [Local record selectors]` which was not referenced * Remove vestiges of `type +v` * Minor fixes to StaticPointers documentation, part of #15603
Diffstat (limited to 'compiler/GHC/Tc')
-rw-r--r--compiler/GHC/Tc/Errors/Hole.hs6
-rw-r--r--compiler/GHC/Tc/Gen/Head.hs8
-rw-r--r--compiler/GHC/Tc/Module.hs2
-rw-r--r--compiler/GHC/Tc/Validity.hs4
4 files changed, 9 insertions, 11 deletions
diff --git a/compiler/GHC/Tc/Errors/Hole.hs b/compiler/GHC/Tc/Errors/Hole.hs
index 00e948bd10..d1c727da35 100644
--- a/compiler/GHC/Tc/Errors/Hole.hs
+++ b/compiler/GHC/Tc/Errors/Hole.hs
@@ -484,12 +484,10 @@ pprHoleFit (HFDC sWrp sWrpVars sTy sProv sMs) (HoleFit {..}) =
hang display 2 provenance
where tyApp = sep $ zipWithEqual "pprHoleFit" pprArg vars hfWrap
where pprArg b arg = case binderArgFlag b of
- -- See Note [Explicit Case Statement for Specificity]
- (Invisible spec) -> case spec of
- SpecifiedSpec -> text "@" <> pprParendType arg
+ Specified -> text "@" <> pprParendType arg
-- Do not print type application for inferred
-- variables (#16456)
- InferredSpec -> empty
+ Inferred -> empty
Required -> pprPanic "pprHoleFit: bad Required"
(ppr b <+> ppr arg)
tyAppVars = sep $ punctuate comma $
diff --git a/compiler/GHC/Tc/Gen/Head.hs b/compiler/GHC/Tc/Gen/Head.hs
index 821b118ded..9fbd972f8a 100644
--- a/compiler/GHC/Tc/Gen/Head.hs
+++ b/compiler/GHC/Tc/Gen/Head.hs
@@ -483,7 +483,7 @@ tcInferRecSelId (FieldOcc sel_name lbl)
= do { thing <- tcLookup sel_name
; case thing of
ATcId { tct_id = id }
- -> do { check_naughty occ id
+ -> do { check_naughty occ id -- See Note [Local record selectors]
; check_local_id id
; return id }
@@ -1034,11 +1034,11 @@ errors in a polymorphic situation.
If this check fails (which isn't impossible) we get another chance; see
Note [Converting strings] in Convert.hs
-Local record selectors
-~~~~~~~~~~~~~~~~~~~~~~
+Note [Local record selectors]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Record selectors for TyCons in this module are ordinary local bindings,
which show up as ATcIds rather than AGlobals. So we need to check for
-naughtiness in both branches. c.f. TcTyClsBindings.mkAuxBinds.
+naughtiness in both branches. c.f. GHC.Tc.TyCl.Utils.mkRecSelBinds.
-}
diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs
index e2a53c4f39..dca730f6f0 100644
--- a/compiler/GHC/Tc/Module.hs
+++ b/compiler/GHC/Tc/Module.hs
@@ -2708,7 +2708,7 @@ https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0179-printi
reverse :: forall a. [a] -> [a]
-- foo :: forall a f b. (Show a, Num b, Foldable f) => a -> f b -> String
- > :type +v foo @Int
+ > :type foo @Int
forall f b. (Show Int, Num b, Foldable f) => Int -> f b -> String
Note that Show Int is still reported, because the solver never got a chance
diff --git a/compiler/GHC/Tc/Validity.hs b/compiler/GHC/Tc/Validity.hs
index de007d0fac..c5dc68469f 100644
--- a/compiler/GHC/Tc/Validity.hs
+++ b/compiler/GHC/Tc/Validity.hs
@@ -433,7 +433,7 @@ checkTySynRhs ctxt ty
; expand <- initialExpandMode
; check_pred_ty emptyTidyEnv dflags ctxt expand ty })
else addErrTcM ( emptyTidyEnv
- , TcRnIllegalConstraintSynonymOfKind (tidyKind emptyTidyEnv actual_kind)
+ , TcRnIllegalConstraintSynonymOfKind (tidyType emptyTidyEnv actual_kind)
) }
| otherwise
@@ -923,7 +923,7 @@ forAllEscapeErr env tvbs theta tau tau_kind
-- NB: Don't tidy the sigma type since the tvbs were already tidied
-- previously, and re-tidying them will make the names of type
-- variables different from tau_kind.
- = (env, TcRnForAllEscapeError (mkSigmaTy tvbs theta tau) (tidyKind env tau_kind))
+ = (env, TcRnForAllEscapeError (mkSigmaTy tvbs theta tau) (tidyType env tau_kind))
{-
Note [Type variables escaping through kinds]