dmd.errors

Functions for raising errors.

Public Imports

core.stdc.stdarg
public import core.stdc.stdarg;
Undocumented in source.

Members

Aliases

DiagnosticHandler
alias DiagnosticHandler = bool delegate(const ref Loc location, Color headerColor, const(char)* header, const(char)* messageFormat, va_list args, const(char)* prefix1, const(char)* prefix2)

The type of the diagnostic handler see verrorReport for arguments

FatalErrorHandler
alias FatalErrorHandler = bool delegate()

The type of the fatal error handler

Classes

ErrorSinkCompiler
class ErrorSinkCompiler

Error message sink for D compiler.

Enums

Classification
enum Classification

Color highlighting to classify messages

ErrorKind
enum ErrorKind

Constants used to discriminate kinds of error messages.

HIGHLIGHT
enum HIGHLIGHT

Embed these highlighting commands in the text stream. HIGHLIGHT.Escape indicates a Color follows.

Functions

deprecation
void deprecation(Loc loc, const(char)* format, ...)

Print a deprecation message, may increase the global warning or error count depending on whether deprecations are ignored.

deprecationSupplemental
void deprecationSupplemental(Loc loc, const(char)* format, ...)

Print additional details about a deprecation message. Doesn't increase the error count, or print an additional deprecation prefix.

error
void error(Loc loc, const(char)* format, ...)

Print an error message, increasing the global error count.

error
void error(const(char)* filename, uint linnum, uint charnum, const(char)* format, ...)

Same as above, but takes a filename and line information arguments as separate parameters.

errorSupplemental
void errorSupplemental(Loc loc, const(char)* format, ...)

Print additional details about an error message. Doesn't increase the error count or print an additional error prefix.

fatal
void fatal()

Call this after printing out fatal error messages to clean up and exit the compiler. You can also set a fatalErrorHandler to override this behaviour.

halt
void halt()

Try to stop forgetting to remove the breakpoints from release builds.

message
void message(Loc loc, const(char)* format, ...)

Print a verbose message. Doesn't prefix or highlight messages.

message
void message(const(char)* format, ...)

Same as above, but doesn't take a location argument.

tip
void tip(const(char)* format, ...)

Print a tip message with the prefix and highlighting.

verrorReport
void verrorReport(Loc loc, const(char)* format, va_list ap, ErrorKind kind, const(char)* p1, const(char)* p2)

Implements error, warning, deprecation, message, and tip. Report a diagnostic error, taking a va_list parameter, and optionally additional message prefixes. Whether the message gets printed depends on runtime values of DiagnosticReporting and global gagging.

verrorReportSupplemental
void verrorReportSupplemental(Loc loc, const(char)* format, va_list ap, ErrorKind kind)

Implements errorSupplemental, warningSupplemental, and deprecationSupplemental. Report an addition diagnostic error, taking a va_list parameter. Whether the message gets printed depends on runtime values of DiagnosticReporting and global gagging.

warning
void warning(Loc loc, const(char)* format, ...)

Print a warning message, increasing the global warning count.

warningSupplemental
void warningSupplemental(Loc loc, const(char)* format, ...)

Print additional details about a warning message. Doesn't increase the warning count or print an additional warning prefix.

Static variables

diagnosticHandler
DiagnosticHandler diagnosticHandler;

The diagnostic handler. If non-null it will be called for every diagnostic message issued by the compiler. If it returns false, the message will be printed to stderr as usual.

fatalErrorHandler
FatalErrorHandler fatalErrorHandler;

The fatal error handler. If non-null it will be called for every fatal() call issued by the compiler.

Meta