[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.
Properties
Section titled “Properties”| Property | Modifier | Type | Description |
|---|---|---|---|
code | public | string | Diagnostic identifier, qualified as <library-name>/<code> for library diagnostics. |
codefixes? | readonly | readonly CodeFix[] | Available fixes offered to consumers; attaching a fix does not execute it. |
message | public | string | Human-readable message with any diagnostic format arguments already substituted. |
severity | public | DiagnosticSeverity | Factories use the definition’s severity. Program reporting may promote warnings to errors in program.diagnostics when warningAsError is enabled. |
target | public | | DiagnosticTarget | typeof NoTarget | Location-bearing target, or NoTarget for an issue without a source location. |