dmd.errors

Functions for raising errors.

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 verrorPrint 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

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.

vdeprecation
void vdeprecation(Loc loc, const(char)* format, va_list ap, const(char)* p1, const(char)* p2)

Same as deprecation, but takes a va_list parameter, and optionally additional message prefixes.

vdeprecationSupplemental
void vdeprecationSupplemental(Loc loc, const(char)* format, va_list ap)

Same as deprecationSupplemental, but takes a va_list parameter.

verror
void verror(Loc loc, const(char)* format, va_list ap, const(char)* p1, const(char)* p2, const(char)* header)

Same as error, but takes a va_list parameter, and optionally additional message prefixes.

verrorSupplemental
void verrorSupplemental(Loc loc, const(char)* format, va_list ap)

Same as errorSupplemental, but takes a va_list parameter.

vmessage
void vmessage(Loc loc, const(char)* format, va_list ap)

Same as message, but takes a va_list parameter.

vtip
void vtip(const(char)* format, va_list ap)

Same as tip, but takes a va_list parameter.

vwarning
void vwarning(Loc loc, const(char)* format, va_list ap)

Same as warning, but takes a va_list parameter.

vwarningSupplemental
void vwarningSupplemental(Loc loc, const(char)* format, va_list ap)

Same as warningSupplemental, but takes a va_list parameter.

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