Beacon Diagnostic Codes

Beacon’s Diagnostic provider combines parser feedback, Hindley–Milner type errors, annotation coverage checks, control/data-flow analysis, and workspace import resolution into a single stream of LSP diagnostics.

This guide lists every diagnostic code emitted by that pipeline so you can interpret squiggles quickly and trace them back to the subsystem described in Type Checking, Static Analyzer, and Type Checking Modes.

LSP severity for imports (circular vs. unresolved) remains configurable under [diagnostics] as documented in Configuration. To temporarily suppress any diagnostic, use the mechanisms described in Suppressions.


Legend:

  • ⚠ = Warning
  • ✕ = Error
  • ⓘ = Info/Hints

Note that per-mode rows show the icon used in strict / balanced / relaxed order

CodeNameLevelCategoryDescription
ANY001UnsafeAnyUsageType SafetyDeep inference found an Any value, reducing type safety.
ANN001AnnotationMismatch✕ ⚠ ⓘAnnotationsDeclared annotation disagrees with the inferred type.
ANN002MissingVariableAnnotation✕ ⚠AnnotationsAssignment lacks an annotation in strict/balanced modes.
ANN003ParameterAnnotationMismatch✕ ⚠ ⓘAnnotationsParameter annotation conflicts with inferred usage.
ANN004MissingParameterAnnotation✕ ⚠AnnotationsParameter missing annotation when inference is precise.
ANN005ReturnAnnotationMismatch✕ ⚠ ⓘAnnotationsFunction return annotation disagrees with inference.
ANN006MissingReturnAnnotation✕ ⚠AnnotationsFunction lacks return annotation when inference is concrete.
ANN007ImplicitAnyParameterAnnotationsStrict mode forbids implicit Any on parameters.
ANN008ImplicitAnyReturnAnnotationsStrict mode forbids implicit Any return types.
ANN009MissingClassAttributeAnnotationAnnotationsStrict mode requires explicit annotations on class attributes.
ANN010BareExceptClauseAnnotationsStrict mode forbids bare except: clauses without exception types.
ANN011ParameterImplicitAnyAnnotationsBalanced mode warns when parameter type resolves to implicit Any.
ANN012ReturnImplicitAnyAnnotationsBalanced mode warns when return type resolves to implicit Any.
DUNDER_INFOEntryPointGuardDunder PatternsHighlights if __name__ == "__main__": guard blocks.
DUNDER001MagicMethodOutOfScopeDunder PatternsMagic methods defined outside a class.
HM001TypeMismatchType SystemHindley–Milner could not unify two types.
HM002OccursCheckFailedType SystemRecursive type variable detected (infinite type).
HM003UndefinedTypeVarType SystemReferenced type variable was never declared.
HM004KindMismatchType SystemWrong number of type arguments supplied to a generic.
HM005InfiniteTypeType SystemInference produced a non-terminating type (self-referential).
HM006ProtocolNotSatisfiedType SystemValue fails to implement the required protocol methods.
HM007AttributeNotFoundAttributesAttribute or method does not exist on the receiver type.
HM008ArgumentCountMismatchType SystemCall site passes too many or too few arguments.
HM009ArgumentTypeMismatchType SystemArgument type incompatible with the parameter type.
HM010PatternTypeMismatchPattern TypingMatch/case pattern cannot match the subject type.
HM011KeywordArgumentErrorType SystemUnknown or duplicate keyword arguments in a call.
HM012GenericTypeErrorType SystemCatch-all Hindley–Milner error (value restriction, etc.).
HM013PatternStructureMismatchPattern TypingPattern shape (mapping, class, sequence) differs from subject.
HM014VarianceErrorVarianceInvariant/covariant/contravariant constraint violated.
MODE_INFOTypeCheckingModeModeReminder showing which type-checking mode produced diagnostics.
PM001PatternNonExhaustivePatternsMatch statement fails to cover every possible case.
PM002PatternUnreachablePatternsLater pattern is shadowed by an earlier one.
circular-importCircularImport✕ ⚠ ⓘImportsModule participates in an import cycle (severity comes from config).
missing-moduleMissingModuleImportsReferenced module is absent from the workspace/stubs.
shadowed-variableShadowedVariableScopeInner scope reuses a name that already exists in an outer scope.
undefined-variableUndefinedVariableName ResolutionName used before being defined anywhere.
unresolved-importUnresolvedImport✕ ⚠ ⓘImportsImport target cannot be resolved (severity configurable).
unreachable-codeUnreachableCodeData FlowCode after return, raise, or break never executes.
unused-variableUnusedVariableData FlowVariable assigned but never read.
use-before-defUseBeforeDefData FlowVariable read before it is assigned in the current scope.

Diagnostics by Category