Skip to content

Diagnostic

A compiler diagnostic produced by compile.

Fields

severity

The diagnostic severity as a symbol:

  • :error:
  • :warning:

message

The primary diagnostic message as str.

span

The primary source Span for the diagnostic.

annotations

An array of Annotation objects describing additional highlighted source regions.

notes

An array of Note objects with extra context or help.

patches

An array of Patch objects describing suggested edits.

Example

let result = compile "bad.dol" "let =\n"
import diagnostic
for diag = result.diagnostics
  diagnostic.print_compile_diag $diag