| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
GHC.Tc.Types.ErrCtxt
Contents
Synopsis
- data HsCtxt
- = ExprCtxt !(HsExpr GhcRn)
- | ThetaCtxt !UserTypeCtxt !ThetaType
- | QuantifiedCtCtxt !PredType
- | InferredTypeCtxt !Name !TcType
- | SigCtxt !(Sig GhcRn)
- | UserSigCtxt !UserTypeCtxt !UserSigType
- | RecordUpdCtxt !(NonEmpty ConLike) ![Name] ![TyCoVar]
- | ClassOpCtxt !Id !Type
- | MethSigCtxt !Name !TcType !TcType
- | PatSigErrCtxt !TcType !ExpType
- | PatCtxt !(Pat GhcRn)
- | PatSynDeclCtxt !Name
- | MatchCtxt !HsMatchContextRn
- | Outputable body => MatchInCtxt !(Match GhcRn body)
- | FunAppCtxt !FunAppCtxtFunArg !Int
- | FunTysCtxt !ExpectedFunTyCtxt !Type !Int !Int
- | FunResCtxt !(HsExpr GhcTc) !Int !TcType !ExpType
- | TyConDeclCtxt !Name !(TyConFlavour TyCon)
- | TyConInstCtxt !Name !TyConInstFlavour
- | DataConDefCtxt !(NonEmpty (LocatedN Name))
- | DataConResTyCtxt !(NonEmpty (LocatedN Name))
- | ClosedFamEqnCtxt !TyCon
- | TySynErrCtxt !TyCon
- | RoleAnnotErrCtxt !Name
- | CmdCtxt !(HsCmd GhcRn)
- | InstDeclErrCtxt !(Either (LHsType GhcRn) PredType)
- | DefaultDeclErrCtxt { }
- | StaticFormCtxt !(LHsExpr GhcRn)
- | OutputableBndrId p => PatMonoBindsCtxt !(LPat (GhcPass p)) !(GRHSs GhcRn (LHsExpr GhcRn))
- | ForeignDeclCtxt !(ForeignDecl GhcRn)
- | FieldCtxt !FieldLabelString
- | TypeCtxt !(LHsType GhcRn)
- | KindCtxt !(LHsKind GhcRn)
- | AmbiguityCheckCtxt !UserTypeCtxt !Bool
- | TermLevelUseCtxt !Name !TermLevelUseCtxt
- | MainCtxt !Name
- | VDQWarningCtxt !TcTyCon
- | (Anno (StmtLR GhcRn GhcRn body) ~ SrcSpanAnnA, Outputable body) => StmtErrCtxt !HsStmtContextRn !(LStmtLR GhcRn GhcRn body)
- | StmtErrCtxtPat (LPat GhcRn)
- | SyntaxNameCtxt !(HsExpr GhcRn) !CtOrigin !TcType !SrcSpan
- | RuleCtxt !FastString
- | SubTypeCtxt !TcType !TcType
- | OutputableBndrId p => ExportCtxt (IE (GhcPass p))
- | PatSynExportCtxt !PatSyn
- | PatSynRecSelExportCtxt !PatSyn !Name
- | OutputableBndrId p => AnnCtxt (AnnDecl (GhcPass p))
- | SpecPragmaCtxt !(Sig GhcRn)
- | DerivInstCtxt !PredType
- | StandaloneDerivCtxt !(LHsSigWcType GhcRn)
- | DerivBindCtxt !Id !Class ![Type]
- | UntypedTHBracketCtxt !(HsQuote GhcPs)
- | OutputableBndrId p => TypedTHBracketCtxt !(LHsExpr (GhcPass p))
- | UntypedSpliceCtxt !(HsUntypedSplice GhcPs)
- | OutputableBndrId p => TypedSpliceCtxt !(Maybe SplicePointName) !(HsTypedSplice (GhcPass p))
- | TypedSpliceResultCtxt !(LHsExpr GhcTc)
- | ReifyInstancesCtxt !Name ![Type]
- | MergeSignaturesCtxt !UnitState !ModuleName ![InstantiatedModule]
- | CheckImplementsCtxt !UnitState !Module !InstantiatedModule
- isHsCtxtLandmark :: HsCtxt -> Bool
- data UserSigType
- = UserLHsSigType !(LHsSigType GhcRn)
- | UserLHsType !(LHsType GhcRn)
- data FunAppCtxtFunArg
- = FunAppCtxtExpr !(HsExpr GhcRn) !(HsExpr GhcRn)
- | FunAppCtxtTy !(LHsType GhcRn) !(LHsType GhcRn)
- data TyConInstFlavour = TyConInstFlavour {}
- type ErrCtxtStack = [HsCtxt]
- data UserTypeCtxt
- = FunSigCtxt Name ReportRedundantConstraints
- | InfSigCtxt Name
- | ExprSigCtxt ReportRedundantConstraints
- | KindSigCtxt
- | StandaloneKindSigCtxt Name
- | TypeAppCtxt
- | ConArgCtxt Name
- | TySynCtxt Name
- | PatSynCtxt Name
- | PatSigCtxt
- | ForSigCtxt Name
- | DefaultDeclCtxt
- | InstDeclCtxt Bool
- | SpecInstCtxt
- | GenSigCtxt
- | GhciCtxt Bool
- | ClassSCCtxt Name
- | SigmaCtxt
- | DataTyCtxt Name
- | DerivClauseCtxt
- | TyVarBndrKindCtxt Name
- | RuleBndrTypeCtxt Name
- | DataKindCtxt Name
- | TySynKindCtxt Name
- | TyFamResKindCtxt Name
- pprUserTypeCtxt :: UserTypeCtxt -> SDoc
- isSigMaybe :: UserTypeCtxt -> Maybe Name
- data ReportRedundantConstraints
- reportRedundantConstraints :: ReportRedundantConstraints -> Bool
- redundantConstraintsSpan :: UserTypeCtxt -> SrcSpan
Documentation
The "context" of an error message, e.g. "In the expression ...", "In the pattern ...", or "In the equations for closed type family ...".
Constructors
| ExprCtxt !(HsExpr GhcRn) | In an expression. |
| ThetaCtxt !UserTypeCtxt !ThetaType | In a user-written context. |
| QuantifiedCtCtxt !PredType | In a quantified constraint. |
| InferredTypeCtxt !Name !TcType | When checking an inferred type. |
| SigCtxt !(Sig GhcRn) | In an inline pragma, or a fixity signature,
or a type signature, or... (see |
| UserSigCtxt !UserTypeCtxt !UserSigType | In a user-written type signature. |
| RecordUpdCtxt !(NonEmpty ConLike) ![Name] ![TyCoVar] | In a record update. |
| ClassOpCtxt !Id !Type | In a class method. |
| MethSigCtxt !Name !TcType !TcType | In the instance type signature of a class method. |
| PatSigErrCtxt !TcType !ExpType | In a pattern type signature. |
| PatCtxt !(Pat GhcRn) | In a pattern. |
| PatSynDeclCtxt !Name | In a pattern synonym declaration. |
| MatchCtxt !HsMatchContextRn | In a pattern matching context, e.g. a equation for a function binding, or a case alternative, ... |
| Outputable body => MatchInCtxt !(Match GhcRn body) | In a match in a pattern matching context, either for an expression or for an arrow command. |
| FunAppCtxt !FunAppCtxtFunArg !Int | In a function application. |
| FunTysCtxt !ExpectedFunTyCtxt !Type !Int !Int | In a function call. |
| FunResCtxt !(HsExpr GhcTc) !Int !TcType !ExpType | In the result of a function call. |
| TyConDeclCtxt !Name !(TyConFlavour TyCon) | In the declaration of a type constructor. |
| TyConInstCtxt !Name !TyConInstFlavour | In a type or data family instance (or default instance). |
| DataConDefCtxt !(NonEmpty (LocatedN Name)) | In the declaration of a data constructor. |
| DataConResTyCtxt !(NonEmpty (LocatedN Name)) | In the result type of a data constructor. |
| ClosedFamEqnCtxt !TyCon | In the equations for a closed type family. |
| TySynErrCtxt !TyCon | In the expansion of a type synonym. |
| RoleAnnotErrCtxt !Name | In a role annotation. |
| CmdCtxt !(HsCmd GhcRn) | In an arrow command. |
| InstDeclErrCtxt !(Either (LHsType GhcRn) PredType) | In an instance declaration. |
| DefaultDeclErrCtxt | In a default declaration. |
Fields | |
| StaticFormCtxt !(LHsExpr GhcRn) | In the body of a static form. |
| OutputableBndrId p => PatMonoBindsCtxt !(LPat (GhcPass p)) !(GRHSs GhcRn (LHsExpr GhcRn)) | In a pattern binding. |
| ForeignDeclCtxt !(ForeignDecl GhcRn) | In a foreign import/export declaration. |
| FieldCtxt !FieldLabelString | In a record field. |
| TypeCtxt !(LHsType GhcRn) | In a type. |
| KindCtxt !(LHsKind GhcRn) | In a kind. |
| AmbiguityCheckCtxt !UserTypeCtxt !Bool | In an ambiguity check. |
| TermLevelUseCtxt !Name !TermLevelUseCtxt | In a term-level use of a |
| MainCtxt !Name | When checking the type of the |
| VDQWarningCtxt !TcTyCon | Warning emitted when inferring use of visible dependent quantification. |
| (Anno (StmtLR GhcRn GhcRn body) ~ SrcSpanAnnA, Outputable body) => StmtErrCtxt !HsStmtContextRn !(LStmtLR GhcRn GhcRn body) | In a statement |
| StmtErrCtxtPat (LPat GhcRn) | In patten of the do statement. (c.f. MonadFailErrors) |
| SyntaxNameCtxt !(HsExpr GhcRn) !CtOrigin !TcType !SrcSpan | In an rebindable syntax expression. |
| RuleCtxt !FastString | In a RULE. |
| SubTypeCtxt !TcType !TcType | In a subtype check. |
| OutputableBndrId p => ExportCtxt (IE (GhcPass p)) | In an export. |
| PatSynExportCtxt !PatSyn | In an export of a pattern synonym. |
| PatSynRecSelExportCtxt !PatSyn !Name | In an export of a pattern synonym record field. |
| OutputableBndrId p => AnnCtxt (AnnDecl (GhcPass p)) | In an annotation. |
| SpecPragmaCtxt !(Sig GhcRn) | In a specialise pragma. |
| DerivInstCtxt !PredType | In a deriving clause. |
| StandaloneDerivCtxt !(LHsSigWcType GhcRn) | In a standalone deriving clause. |
| DerivBindCtxt !Id !Class ![Type] | When typechecking the body of a derived instance. |
| UntypedTHBracketCtxt !(HsQuote GhcPs) | In an untyped Template Haskell quote. |
| OutputableBndrId p => TypedTHBracketCtxt !(LHsExpr (GhcPass p)) | In a typed Template Haskell quote. |
| UntypedSpliceCtxt !(HsUntypedSplice GhcPs) | In an untyped Template Haskell splice or quasi-quote. |
| OutputableBndrId p => TypedSpliceCtxt !(Maybe SplicePointName) !(HsTypedSplice (GhcPass p)) | In a typed Template Haskell splice. |
| TypedSpliceResultCtxt !(LHsExpr GhcTc) | In the result of a typed Template Haskell splice. |
| ReifyInstancesCtxt !Name ![Type] | In an argument to the Template Haskell |
| MergeSignaturesCtxt !UnitState !ModuleName ![InstantiatedModule] | While merging Backpack signatures. |
| CheckImplementsCtxt !UnitState !Module !InstantiatedModule | While checking that a module implements a Backpack signature. |
Instances
| Data HsCtxt Source # | |
Defined in GHC.Hs.Instances Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsCtxt -> c HsCtxt Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c HsCtxt Source # toConstr :: HsCtxt -> Constr Source # dataTypeOf :: HsCtxt -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c HsCtxt) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsCtxt) Source # gmapT :: (forall b. Data b => b -> b) -> HsCtxt -> HsCtxt Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsCtxt -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsCtxt -> r Source # gmapQ :: (forall d. Data d => d -> u) -> HsCtxt -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsCtxt -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsCtxt -> m HsCtxt Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsCtxt -> m HsCtxt Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsCtxt -> m HsCtxt Source # | |
isHsCtxtLandmark :: HsCtxt -> Bool Source #
data UserSigType Source #
Constructors
| UserLHsSigType !(LHsSigType GhcRn) | |
| UserLHsType !(LHsType GhcRn) |
Instances
| Outputable UserSigType Source # | |
Defined in GHC.Tc.Types.ErrCtxt Methods ppr :: UserSigType -> SDoc Source # | |
data FunAppCtxtFunArg Source #
Constructors
| FunAppCtxtExpr !(HsExpr GhcRn) !(HsExpr GhcRn) | |
| FunAppCtxtTy !(LHsType GhcRn) !(LHsType GhcRn) |
data TyConInstFlavour Source #
Like TyConFlavour but for instance declarations, with
the additional information of whether this we are dealing with
a default declaration.
Constructors
| TyConInstFlavour | |
Fields
| |
type ErrCtxtStack = [HsCtxt] Source #
UserTypeCtxt
data UserTypeCtxt Source #
UserTypeCtxt describes the origin of the polymorphic type in the places where we need an expression to have that type
Constructors
Instances
| Eq UserTypeCtxt Source # | |
Defined in GHC.Tc.Types.ErrCtxt Methods (==) :: UserTypeCtxt -> UserTypeCtxt -> Bool Source # (/=) :: UserTypeCtxt -> UserTypeCtxt -> Bool Source # | |
pprUserTypeCtxt :: UserTypeCtxt -> SDoc Source #
isSigMaybe :: UserTypeCtxt -> Maybe Name Source #
data ReportRedundantConstraints Source #
Report Redundant Constraints.
Constructors
| NoRRC | Don't report redundant constraints |
| WantRRC SrcSpan | Report redundant constraints The SrcSpan is for the constraints E.g. f :: (Eq a, Ord b) => blah The span is for the (Eq a, Ord b) We need to record the span here because we have long since discarded the HsType in favour of a Type |
Instances
| Eq ReportRedundantConstraints Source # | |
Defined in GHC.Tc.Types.ErrCtxt Methods (==) :: ReportRedundantConstraints -> ReportRedundantConstraints -> Bool Source # (/=) :: ReportRedundantConstraints -> ReportRedundantConstraints -> Bool Source # | |