diff options
Diffstat (limited to 'compiler/GHC/Tc')
-rw-r--r-- | compiler/GHC/Tc/Errors.hs | 4 | ||||
-rw-r--r-- | compiler/GHC/Tc/Errors/Ppr.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Tc/Errors/Types.hs | 3 | ||||
-rw-r--r-- | compiler/GHC/Tc/Gen/Arrow.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Tc/Gen/Foreign.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Tc/Gen/Match.hs | 6 | ||||
-rw-r--r-- | compiler/GHC/Tc/Gen/Pat.hs | 8 | ||||
-rw-r--r-- | compiler/GHC/Tc/TyCl.hs | 5 | ||||
-rw-r--r-- | compiler/GHC/Tc/TyCl/Instance.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Tc/Types.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Tc/Utils/Env.hs | 7 | ||||
-rw-r--r-- | compiler/GHC/Tc/Utils/TcMType.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Tc/Utils/TcType.hs | 2 |
13 files changed, 19 insertions, 28 deletions
diff --git a/compiler/GHC/Tc/Errors.hs b/compiler/GHC/Tc/Errors.hs index 8c46285ad4..237c6fa4a3 100644 --- a/compiler/GHC/Tc/Errors.hs +++ b/compiler/GHC/Tc/Errors.hs @@ -175,7 +175,7 @@ reportUnsolved wanted -- NB: Type-level holes are OK, because there are no bindings. -- See Note [Deferring coercion errors to runtime] -- Used by solveEqualities for kind equalities --- (see Note [Fail fast on kind errors] in "GHC.Tc.Solver") +-- (see Note [Failure in local type signatures] in GHC.Tc.Solver) reportAllUnsolved :: WantedConstraints -> TcM () reportAllUnsolved wanted = do { ev_binds <- newNoTcEvBinds @@ -2237,7 +2237,7 @@ something like Discussion in #9611. Note [Highlighting ambiguous type variables] -~------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When we encounter ambiguous type variables (i.e. type variables that remain metavariables after type inference), we need a few more conditions before we can reason that *ambiguity* prevents constraints diff --git a/compiler/GHC/Tc/Errors/Ppr.hs b/compiler/GHC/Tc/Errors/Ppr.hs index 86aac8d99d..d8d9ff0302 100644 --- a/compiler/GHC/Tc/Errors/Ppr.hs +++ b/compiler/GHC/Tc/Errors/Ppr.hs @@ -2233,7 +2233,7 @@ pprTcSolverReportMsg ctxt@(CEC {cec_encl = implics}) orig = errorItemOrigin item pred = errorItemPred item (clas, tys) = getClassPredTys pred - -- See Note [Highlighting ambiguous type variables] + -- See Note [Highlighting ambiguous type variables] in GHC.Tc.Errors (ambig_kvs, ambig_tvs) = ambigTkvsOfTy pred ambigs = ambig_kvs ++ ambig_tvs has_ambigs = not (null ambigs) diff --git a/compiler/GHC/Tc/Errors/Types.hs b/compiler/GHC/Tc/Errors/Types.hs index b86f1d1506..b1f635325a 100644 --- a/compiler/GHC/Tc/Errors/Types.hs +++ b/compiler/GHC/Tc/Errors/Types.hs @@ -2976,8 +2976,7 @@ data PromotionErr -- in GHC.Tc.Utils.Env. | ConstrainedDataConPE PredType -- Data constructor with a non-equality context - -- See Note [Don't promote data constructors with - -- non-equality contexts] in GHC.Tc.Gen.HsType + -- See Note [Constraints in kinds] in GHC.Core.TyCo.Rep | PatSynPE -- Pattern synonyms -- See Note [Don't promote pattern synonyms] in GHC.Tc.Utils.Env diff --git a/compiler/GHC/Tc/Gen/Arrow.hs b/compiler/GHC/Tc/Gen/Arrow.hs index b404a00b1a..a4eff74ea4 100644 --- a/compiler/GHC/Tc/Gen/Arrow.hs +++ b/compiler/GHC/Tc/Gen/Arrow.hs @@ -435,7 +435,7 @@ tcArrDoStmt env ctxt (RecStmt { recS_stmts = L l stmts, recS_later_ids = later_n -- NB: The rec_ids for the recursive things -- already scope over this part. This binding may shadow -- some of them with polymorphic things with the same Name - -- (see Note [RecStmt] in GHC.Hs.Expr) + -- (see Note [How RecStmt works] in Language.Haskell.Syntax.Expr) ; let rec_ids = takeList rec_names tup_ids ; later_ids <- tcLookupLocalIds later_names diff --git a/compiler/GHC/Tc/Gen/Foreign.hs b/compiler/GHC/Tc/Gen/Foreign.hs index 53e880c0f6..31f47227c8 100644 --- a/compiler/GHC/Tc/Gen/Foreign.hs +++ b/compiler/GHC/Tc/Gen/Foreign.hs @@ -146,7 +146,7 @@ normaliseFfiType' env ty0 = runWriterT $ go Representational initRecTc ty0 | isNewTyCon tc -- Expand newtypes , Just rec_nts' <- checkRecTc rec_nts tc - -- See Note [Expanding newtypes] in GHC.Core.TyCon + -- See Note [Expanding newtypes and products] in GHC.Core.TyCon.RecWalk -- We can't just use isRecursiveTyCon; sometimes recursion is ok: -- newtype T = T (Ptr T) -- Here, we don't reject the type for being recursive. diff --git a/compiler/GHC/Tc/Gen/Match.hs b/compiler/GHC/Tc/Gen/Match.hs index 05d95bf6d2..9c838785ac 100644 --- a/compiler/GHC/Tc/Gen/Match.hs +++ b/compiler/GHC/Tc/Gen/Match.hs @@ -546,7 +546,7 @@ tcLcStmt m_tc ctxt (TransStmt { trS_form = form, trS_stmts = stmts -- Ensure that every old binder of type `b` is linked up with its -- new binder which should have type `n b` - -- See Note [GroupStmt binder map] in GHC.Hs.Expr + -- See Note [TransStmt binder map] in GHC.Hs.Expr n_bndr_ids = zipWith mk_n_bndr n_bndr_names bndr_ids bindersMap' = bndr_ids `zip` n_bndr_ids @@ -739,7 +739,7 @@ tcMcStmt ctxt (TransStmt { trS_stmts = stmts, trS_bndrs = bindersMap -- Ensure that every old binder of type `b` is linked up with its -- new binder which should have type `n b` - -- See Note [GroupStmt binder map] in GHC.Hs.Expr + -- See Note [TransStmt binder map] in GHC.Hs.Expr n_bndr_ids = zipWithEqual "tcMcStmt" mk_n_bndr n_bndr_names bndr_ids bindersMap' = bndr_ids `zip` n_bndr_ids @@ -1005,7 +1005,7 @@ Otherwise the error shows up when checking the rebindable syntax, and the expected/inferred stuff is back to front (see #3613). Note [typechecking ApplicativeStmt] - +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ join ((\pat1 ... patn -> body) <$> e1 <*> ... <*> en) fresh type variables: diff --git a/compiler/GHC/Tc/Gen/Pat.hs b/compiler/GHC/Tc/Gen/Pat.hs index 487b1512ab..45cedcbc8d 100644 --- a/compiler/GHC/Tc/Gen/Pat.hs +++ b/compiler/GHC/Tc/Gen/Pat.hs @@ -1402,12 +1402,8 @@ which applies more generally (not just within 'proc'), as it's a good plan in general to bypass the constraint simplification step entirely when it's not needed. -************************************************************************ -* * - Note [Pattern coercions] -* * -************************************************************************ - +Note [Pattern coercions] +~~~~~~~~~~~~~~~~~~~~~~~~ In principle, these program would be reasonable: f :: (forall a. a->a) -> Int diff --git a/compiler/GHC/Tc/TyCl.hs b/compiler/GHC/Tc/TyCl.hs index 604740c657..52473f3d93 100644 --- a/compiler/GHC/Tc/TyCl.hs +++ b/compiler/GHC/Tc/TyCl.hs @@ -624,7 +624,7 @@ Note [Missed opportunity to retain higher-rank kinds] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In 'kcTyClGroup', there is a missed opportunity to make kind inference work in a few more cases. The idea is analogous -to Note [Single function non-recursive binding special-case]: +to Note [Special case for non-recursive function bindings]: * If we have an SCC with a single decl, which is non-recursive, instead of creating a unification variable representing the @@ -1892,8 +1892,7 @@ DT3 Eta-expansion: Any forall-bound variables and function arguments in a result is produced by processing the return kind in etaExpandAlgTyCon, called in tcDataDefn. - See also Note [TyConBinders for the result kind signatures of a data type] - in GHC.Tc.Gen.HsType. + See also Note [splitTyConKind] in GHC.Tc.Gen.HsType. DT4 Datatype return kind restriction: A data type return kind must end in a type that, after type-synonym expansion, yields `TYPE LiftedRep`. By diff --git a/compiler/GHC/Tc/TyCl/Instance.hs b/compiler/GHC/Tc/TyCl/Instance.hs index 24802a65ea..90951272a2 100644 --- a/compiler/GHC/Tc/TyCl/Instance.hs +++ b/compiler/GHC/Tc/TyCl/Instance.hs @@ -944,7 +944,7 @@ tcDataFamInstHeader mb_clsinfo skol_info fam_tc hs_outer_bndrs fixity -- clearer to duplicate it. Still, if you fix a bug here, -- check there too! - -- See GHC.Tc.TyCl Note [Generalising in tcFamTyPatsGuts] + -- See GHC.Tc.TyCl Note [Generalising in tcTyFamInstEqnGuts] ; dvs <- candidateQTyVarsWithBinders outer_tvs lhs_ty ; qtvs <- quantifyTyVars skol_info TryNotToDefaultNonStandardTyVars dvs ; let final_tvs = scopedSort (qtvs ++ outer_tvs) diff --git a/compiler/GHC/Tc/Types.hs b/compiler/GHC/Tc/Types.hs index bce78dda31..d3f07ac311 100644 --- a/compiler/GHC/Tc/Types.hs +++ b/compiler/GHC/Tc/Types.hs @@ -1214,7 +1214,7 @@ ClosedLet means that - The fvs::RhsNames contains the free names of the RHS, excluding Global and ClosedLet ones. - - For the ClosedTypeId field see Note [Bindings with closed types] + - For the ClosedTypeId field see Note [Bindings with closed types: ClosedTypeId] For (static e) to be valid, we need for every 'x' free in 'e', that x's binding is floatable to the top level. Specifically: diff --git a/compiler/GHC/Tc/Utils/Env.hs b/compiler/GHC/Tc/Utils/Env.hs index b116cbbb29..01fde4cd1a 100644 --- a/compiler/GHC/Tc/Utils/Env.hs +++ b/compiler/GHC/Tc/Utils/Env.hs @@ -553,7 +553,7 @@ tcExtendNameTyVarEnv binds thing_inside names = [(name, ATyVar name tv) | (name, tv) <- binds] isTypeClosedLetBndr :: Id -> Bool --- See Note [Bindings with closed types] in GHC.Tc.Types +-- See Note [Bindings with closed types: ClosedTypeId] in GHC.Tc.Types isTypeClosedLetBndr = noFreeVarsOfType . idType tcExtendRecIds :: [(Name, TcId)] -> TcM a -> TcM a @@ -1125,7 +1125,7 @@ mkWrapperName :: (MonadIO m, HasModule m) => IORef (ModuleEnv Int) -> String -> String -> m FastString -- ^ @mkWrapperName ref what nameBase@ -- --- See Note [Generating fresh names for ccall wrapper] for @ref@'s purpose. +-- See Note [Generating fresh names for FFI wrappers] for @ref@'s purpose. mkWrapperName wrapperRef what nameBase = do thisMod <- getModule let pkg = unitString (moduleUnit thisMod) @@ -1187,9 +1187,6 @@ notFound name } wrongThingErr :: String -> TcTyThing -> Name -> TcM a --- It's important that this only calls pprTcTyThingCategory, which in --- turn does not look at the details of the TcTyThing. --- See Note [Placeholder PatSyn kinds] in GHC.Tc.Gen.Bind wrongThingErr expected thing name = let msg = TcRnUnknownMessage $ mkPlainError noHints $ (pprTcTyThingCategory thing <+> quotes (ppr name) <+> diff --git a/compiler/GHC/Tc/Utils/TcMType.hs b/compiler/GHC/Tc/Utils/TcMType.hs index 1206b95da7..21954240d6 100644 --- a/compiler/GHC/Tc/Utils/TcMType.hs +++ b/compiler/GHC/Tc/Utils/TcMType.hs @@ -747,7 +747,7 @@ skolems. They are used in two places: 1. In kind signatures, see GHC.Tc.TyCl Note [Inferring kinds for type declarations] - and Note [Kind checking for GADTs] + and Note [Using TyVarTvs for kind-checking GADTs] 2. In partial type signatures. See GHC.Tc.Types Note [Quantified variables in partial type signatures] diff --git a/compiler/GHC/Tc/Utils/TcType.hs b/compiler/GHC/Tc/Utils/TcType.hs index 9caf6c9f5b..b5d47d8d5b 100644 --- a/compiler/GHC/Tc/Utils/TcType.hs +++ b/compiler/GHC/Tc/Utils/TcType.hs @@ -588,7 +588,7 @@ we would need to enforce the separation. -} -- A TyVarDetails is inside a TyVar --- See Note [TyVars and TcTyVars] +-- See Note [TyVars and TcTyVars during type checking] data TcTyVarDetails = SkolemTv -- A skolem SkolemInfo |