Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Cryptol.TypeCheck.Error
Synopsis
- cleanupErrors :: [(Range, Error)] -> [(Range, Error)]
- subsumes :: (Range, Error) -> (Range, Error) -> Bool
- data Warning
- data Error
- = KindMismatch (Maybe TypeSource) Kind Kind
- | TooManyTypeParams Int Kind
- | TyVarWithParams
- | TooManyTySynParams Name Int
- | TooFewTyParams Name Int
- | RecursiveTypeDecls [Name]
- | TypeMismatch TypeSource Path Type Type
- | EnumTypeMismatch Type
- | SchemaMismatch Ident Schema Schema
- | RecursiveType TypeSource Path Type Type
- | UnsolvedGoals [Goal]
- | UnsolvableGoals [Goal]
- | UnsolvedDelayedCt DelayedCt
- | UnexpectedTypeWildCard
- | TypeVariableEscaped TypeSource Path Type [TParam]
- | NotForAll TypeSource Path TVar Type
- | TooManyPositionalTypeParams
- | BadParameterKind TParam Kind
- | CannotMixPositionalAndNamedTypeParams
- | UndefinedTypeParameter (Located Ident)
- | RepeatedTypeParameter Ident [Range]
- | AmbiguousSize TVarInfo (Maybe Type)
- | BareTypeApp
- | UndefinedExistVar Name
- | TypeShadowing String Name String
- | MissingModTParam (Located Ident)
- | MissingModVParam (Located Ident)
- | MissingModParam Ident
- | FunctorInstanceMissingArgument Ident
- | FunctorInstanceBadArgument Ident
- | FunctorInstanceMissingName Namespace Ident
- | FunctorInstanceBadBacktick BadBacktickInstance
- | UnsupportedFFIKind TypeSource TParam Kind
- | UnsupportedFFIType TypeSource FFITypeError
- | NestedConstraintGuard Ident
- | DeclarationRequiresSignatureCtrGrd Ident
- | InvalidConstraintGuard Prop
- | InvalidConPat Int Int
- | UncoveredConPat [Name]
- | OverlappingPat (Maybe Ident) [Range]
- | TemporaryError Doc
- data BadBacktickInstance
- data BIWhat
- errorImportance :: Error -> Int
- explainUnsolvable :: NameMap -> [Goal] -> Doc
- computeFreeVarNames :: [(Range, Warning)] -> [(Range, Error)] -> NameMap
Documentation
subsumes :: (Range, Error) -> (Range, Error) -> Bool Source #
Should the first error suppress the next one.
Constructors
DefaultingKind (TParam Name) Kind | |
DefaultingWildType Kind | |
DefaultingTo !TVarInfo Type | |
NonExhaustivePropGuards Name |
Instances
Various errors that might happen during type checking/inference
Constructors
KindMismatch (Maybe TypeSource) Kind Kind | Expected kind, inferred kind |
TooManyTypeParams Int Kind | Number of extra parameters, kind of result
(which should not be of the form |
TyVarWithParams | A type variable was applied to some arguments. |
TooManyTySynParams Name Int | Type-synonym, number of extra params |
TooFewTyParams Name Int | Who is missing params, number of missing params |
RecursiveTypeDecls [Name] | The type synonym declarations are recursive |
TypeMismatch TypeSource Path Type Type | Expected type, inferred type |
EnumTypeMismatch Type | Expected an enum type, but inferred the supplied |
SchemaMismatch Ident Schema Schema | Name of module parameter, expected scehema, actual schema. This may happen when instantiating modules. |
RecursiveType TypeSource Path Type Type | Unification results in a recursive type |
UnsolvedGoals [Goal] | A constraint that we could not solve, usually because there are some left-over variables that we could not infer. |
UnsolvableGoals [Goal] | A constraint that we could not solve and we know it is impossible to do it. |
UnsolvedDelayedCt DelayedCt | A constraint (with context) that we could not solve |
UnexpectedTypeWildCard | Type wild cards are not allowed in this context (e.g., definitions of type synonyms). |
TypeVariableEscaped TypeSource Path Type [TParam] | Unification variable depends on quantified variables that are not in scope. |
NotForAll TypeSource Path TVar Type | Quantified type variables (of kind *) need to match the given type, so it does not work for all types. |
TooManyPositionalTypeParams | Too many positional type arguments, in an explicit type instantiation |
BadParameterKind TParam Kind | Kind other than |
CannotMixPositionalAndNamedTypeParams | |
UndefinedTypeParameter (Located Ident) | |
RepeatedTypeParameter Ident [Range] | |
AmbiguousSize TVarInfo (Maybe Type) | Could not determine the value of a numeric type variable, but we know it must be at least as large as the given type (or unconstrained, if Nothing). |
BareTypeApp | Bare expression of the form `{_} |
UndefinedExistVar Name | |
TypeShadowing String Name String | |
MissingModTParam (Located Ident) | |
MissingModVParam (Located Ident) | |
MissingModParam Ident | |
FunctorInstanceMissingArgument Ident | |
FunctorInstanceBadArgument Ident | |
FunctorInstanceMissingName Namespace Ident | |
FunctorInstanceBadBacktick BadBacktickInstance | |
UnsupportedFFIKind TypeSource TParam Kind | Kind is not supported for FFI |
UnsupportedFFIType TypeSource FFITypeError | Type is not supported for FFI |
NestedConstraintGuard Ident | Constraint guards may only apper at the top-level |
DeclarationRequiresSignatureCtrGrd Ident | All declarataions in a recursive group involving constraint guards should have signatures |
InvalidConstraintGuard Prop | The given constraint may not be used as a constraint guard |
InvalidConPat Int Int | Bad constructor pattern. 1) Number of parameters we have, 2) Number of parameters we need. |
UncoveredConPat [Name] | A |
OverlappingPat (Maybe Ident) [Range] | Overlapping patterns in a case |
TemporaryError Doc | This is for errors that don't fit other cateogories. We should not use it much, and is generally to be used for transient errors, which are due to incomplete implementation. |
Instances
data BadBacktickInstance Source #
Constructors
BIPolymorphicArgument Ident Ident | |
BINested [(BIWhat, Name)] | |
BIMultipleParams Ident |
Instances
Constructors
BIFunctor | |
BIInterface | |
BIPrimitive | |
BIForeign | |
BIAbstractType |
Instances
Generic BIWhat Source # | |
Show BIWhat Source # | |
NFData BIWhat Source # | |
Defined in Cryptol.TypeCheck.Error | |
type Rep BIWhat Source # | |
Defined in Cryptol.TypeCheck.Error type Rep BIWhat = D1 ('MetaData "BIWhat" "Cryptol.TypeCheck.Error" "cryptol-3.1.0-276efOa9Q2aIFSEzDdp2Mp" 'False) ((C1 ('MetaCons "BIFunctor" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BIInterface" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "BIPrimitive" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "BIForeign" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BIAbstractType" 'PrefixI 'False) (U1 :: Type -> Type)))) |
errorImportance :: Error -> Int Source #
When we have multiple errors on the same location, we show only the ones with the has highest rating according to this function.