Diagnostic
public struct Diagnostic : Hashable, Sendable
extension Diagnostic: CustomStringConvertible
A diagnostic related to a region of Hylo source code.
-
The severity of a diagnostic.
See moreDeclaration
Swift
public enum Level : Hashable, Sendable -
The level of the diagnostic.
Declaration
Swift
public let level: Level -
The main description of the diagnostic.
The message should be general and able to stand on its own.
Declaration
Swift
public let message: String -
The source code or source position (if empty) identified as the cause of the error.
Declaration
Swift
public let site: SourceRange -
The sub-diagnostics.
Declaration
Swift
public let notes: [Diagnostic] -
Creates a new diagnostic.
Declaration
Swift
public init(level: Level, message: String, site: SourceRange, notes: [Diagnostic] = []) -
Returns a note with the given
messagehighlightingrange.Declaration
Swift
public static func note(_ message: String, at site: SourceRange) -> Diagnostic -
Returns an error with the given
messagehighlightingrange.Declaration
Swift
public static func error( _ message: String, at site: SourceRange, notes: [Diagnostic] = [] ) -> Diagnostic -
Returns a warning with the given
messagehighlightingrange.Declaration
Swift
public static func warning( _ message: String, at site: SourceRange, notes: [Diagnostic] = [] ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( illegalGlobalBindingIntroducer i: SourceRepresentable<BindingPattern.Introducer> ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( illegalMemberBindingIntroducer i: SourceRepresentable<BindingPattern.Introducer> ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( invalidOperatorLabels found: [String?], expected: [String?], at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( invalidOperatorNotation found: OperatorNotation, expected: OperatorNotation, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(missingFunctionIdentifier d: FunctionDecl) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(missingMethodIdentifier d: MethodDecl) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(missingMethodIdentifierAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(missingSubscriptIdentifier d: SubscriptDecl) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(missingTypeAnnotation p: BindingPattern, in ast: AST) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(missingTypeAnnotation p: ParameterDecl, in ast: AST) -> Diagnostic -
Undocumented
Declaration
-
Undocumented
Declaration
Swift
public static func error(unexpectedCapture p: BindingPattern) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(unexpectedMemberwiseInitializerDecl d: InitializerDecl) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(unexpectedAttribute a: Attribute, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
public static func error( unexpectedMemberModifier m: SourceRepresentable<MemberModifier> ) -> Diagnostic -
Undocumented
Declaration
Swift
public static func error(unexpectedPropertyDecl d: SubscriptDecl) -> Diagnostic -
Returns whether
lshould be logged beforer.Declaration
Swift
public static func isLoggedBefore(_ l: Diagnostic, _ r: Diagnostic) -> Bool -
Declaration
Swift
public var description: String { get } -
Undocumented
Declaration
Swift
static func error(assignOperatorRequiresWhitespaces token: Token) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(expected kind: Token.Kind, at location: SourcePosition) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(expected subject: String, at location: SourcePosition, notes: [Diagnostic] = []) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( expected closerDescription: String, matching opener: Token, in state: ParserState ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(infixOperatorRequiresWhitespacesAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(separatedMutationMarkerAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(separatedPrefixOperatorAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(unexpectedToken token: Token) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(unterminatedCommentStartingAt p: SourcePosition) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(unterminatedStringStartingAt p: SourcePosition) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(duplicateAccessModifier m: SourceRepresentable<AccessModifier>) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( inconsistentAccessModifiers m: SourceRepresentable<AccessModifier>, appearsAfterPreviousAccessModifier p: SourceRepresentable<AccessModifier> ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( duplicateImplementationIntroducer i: SourceRepresentable<AccessEffect> ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(duplicateMemberModifier m: SourceRepresentable<MemberModifier>) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( memberModifier member: SourceRepresentable<MemberModifier>, appearsBeforeAccessModifier access: SourceRepresentable<AccessModifier> ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(unexpectedAccessModifier m: SourceRepresentable<AccessModifier>) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(unexpectedAttribute a: SourceRepresentable<Attribute>) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(unexpectedInitializerDecl d: InitializerDecl) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(unexpectedEffect e: SourceRepresentable<AccessEffect>) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(nestedBindingPattern p: BindingPattern.ID, in ast: AST) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(unknownPragma n: Substring, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( illegalAccessModifierForImplicitParameter e: SourceRepresentable<AccessEffect> ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(declarationRequiresDefinitionAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(ambiguousDisjunctionAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(autoclosureExpectsEmptyEnvironment site: SourceRange, given: AnyType) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( binding a: BindingPattern.Introducer, requiresInitializerAt site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(invalidOptionPattern p: OptionPattern.ID, in ast: AST) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(circularRefinementAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(circularDependencyAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
-
Undocumented
Declaration
Swift
static func error(cannotConstructTrait t: TraitType, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(cannotInferComplexReturnTypeAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(conformanceToNonTraitType type: AnyType, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( redundantConformance c: Conformance, at site: SourceRange, alreadyDeclaredAt originalSite: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(declarationRequiresBodyAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(duplicateCaptureNamed name: String, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( cannotCaptureOverloadedNameImplicitly name: SourceRepresentable<Name> ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(duplicateOperatorNamed name: String, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(duplicateParameterNamed name: String, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
-
Undocumented
Declaration
Swift
static func error<S1: Sequence<String?>, S2: Sequence<String?>>( labels found: S1, incompatibleWith expected: S2, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( type l: AnyType, incompatibleWith r: AnyType, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( expected: AnyType, found: AnyType, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(invalidDestructuringOfType type: AnyType, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(invalidReferenceToSelfTypeAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(invalidParameterType type: AnyType, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(missingReturnValueAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(notATrait type: AnyType, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
public static func error( _ type: AnyType, doesNotConformTo trait: TraitType, at site: SourceRange, because notes: DiagnosticSet = [] ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(tooManyExistentialBoundsAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
-
Undocumented
Declaration
Swift
static func error( invalidConformanceConstraintTo type: AnyType, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( invalidEqualityConstraintBetween l: AnyType, and r: AnyType, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(unsatisfiedWhereClauseAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(notEnoughContextToInferArgumentsAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( notEnoughContextToResolveMember name: SourceRepresentable<Name> ) -> Diagnostic -
Undocumented
Declaration
Swift
static func note( trait x: TraitType, requires r: NodeKind, named n: Name, typed t: AnyType, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func note( trait x: TraitType, requiresAssociatedType n: String, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
-
Undocumented
Declaration
Swift
static func error(undefinedOperator name: String, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func warning(unusedResultOfType type: AnyType, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( invalidGenericArgumentCountTo entity: SourceRepresentable<Name>, found: Int, expected: Int ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( invalidBufferTypeArgumentCount found: Int, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( noViableCandidateToResolve entity: SourceRepresentable<Name>, notes: [Diagnostic] ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(argumentToNonGenericType type: AnyType, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( invalidBufferTypeExprArgumentCount e: SubscriptCallExpr.ID, in ast: AST ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( cannotCall type: AnyType, as entity: CallableEntity, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( undefinedName name: Name, in domain: AnyType? = nil, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( undefinedName name: Int, in domain: AnyType, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(noContextToResolve name: Name, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func warning(unionTypeWithZeroElementsAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(unionTypeWithOneElementAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(valueInUnionTypeAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(_ l: AnyType, isNotSubtypeOf r: AnyType, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( cannotInitialize storageType: AnyType, with valueType: AnyType, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( _ l: AnyType, doesNotMatch pattern: AnyType, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( _ subtype: AnyType, isNotStrictSubtypeOf supertype: AnyType, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
-
Undocumented
Declaration
Swift
static func error(cannotExtend t: AnyType, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( cannotPass t: AnyType, toParameter u: AnyType, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( conditionalHasMismatchingTypes t: [AnyType], at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(noSuchModule n: String, at site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(invalidPointerConversionAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( invalidForLoopDomain m: AnyType, consuming: Bool, at site: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error(fallbackBranchCannotFallThroughAt site: SourceRange) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( referenceTo d: SourceRepresentable<Name>, requires t: AnyType, conformsTo u: TraitType, dueToConstraintAt constraintSite: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( referenceTo d: SourceRepresentable<Name>, requires t: AnyType, equals u: AnyType, dueToConstraintAt constraintSite: SourceRange ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( invalidReferenceToAssociatedType a: AssociatedTypeDecl.ID, at site: SourceRange, in ast: AST ) -> Diagnostic -
Undocumented
Declaration
Swift
static func error( invalidReferenceToInaccessible ds: [AnyDeclID], named n: SourceRepresentable<Name>, in ast: AST ) -> Diagnostic -
Undocumented
-
Undocumented
-
Undocumented
Declaration
Swift
static func warning(needlessImport d: ImportDecl.ID, in ast: AST) -> Diagnostic
View on GitHub