Skip to main content

Module param_annotations

Module param_annotations 

Source
Expand description

The one place that decides whether a parameter must carry a type.

A parameter with no annotation used to mean any, which switches type checking off in both directions: the body may reach for any member, and callers may pass anything. Nothing recovers that type later, so the declaration is a hole rather than a gradual step.

Every consumer of that judgement reads it here. The type checker turns a hit into HARN-TYP-028, and the harn fix annotation repair walks the same list to decide which sites it must fill in. A second predicate elsewhere would let the error and the migration disagree about what needs a type, so there is exactly one.

Structs§

UnannotatedParam
One declared parameter that the rule requires an annotation for.

Enums§

DeclarationKind
The declaration form that owns a parameter list.

Functions§

annotation_insert_offset
Byte offset where : Type belongs for this parameter, or None when the span does not contain the parameter name (a synthetic parameter, or a span that does not line up with source).
help
The repair sentence for one hit.
message
The diagnostic sentence for one hit. Shared so the checker and any other renderer word the rule identically.
requires_annotation
Whether this parameter must carry an explicit type.
unannotated_params
Collect the same list walk_unannotated_params visits.
walk_unannotated_params
Visit every parameter in program that the rule requires a type for, including declarations nested inside another body.