Skip to content

[I] Diagnostic

A fully formatted compiler or library issue. Creating a diagnostic does not report it; pass it to the program’s reporting APIs or return it to the caller as appropriate.

PropertyModifierTypeDescription
codepublicstringDiagnostic identifier, qualified as <library-name>/<code> for library diagnostics.
codefixes?readonlyreadonly CodeFix[]Available fixes offered to consumers; attaching a fix does not execute it.
messagepublicstringHuman-readable message with any diagnostic format arguments already substituted.
severitypublicDiagnosticSeverityFactories use the definition’s severity. Program reporting may promote warnings to errors in program.diagnostics when warningAsError is enabled.
targetpublic| DiagnosticTarget | typeof NoTargetLocation-bearing target, or NoTarget for an issue without a source location.