Skip to content

Diagnostic

A compiler diagnostic.

Example

let unit = compile "bad.dol" "let =\n"
for diag = unit.diagnostics()
  echo $diag.render()

Fields

annotations @ Array[Annotation]

Additional highlighted source regions.

message @ Str

The primary diagnostic message.

notes @ Array[Note]

Notes with extra context or help.

patches @ Array[Patch]

Suggested edits.

severity @ (:ERROR: | :WARNING:)

The severity.

span @ Span

The primary source span.

Methods

render() -> term.Text

Renders the diagnostic for terminal presentation.

Returns

The rendering, without a final newline.