Movatterモバイル変換


[0]ホーム

URL:


D Logo
Menu
Search

Library Reference

version 2.112.0

overview

Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinga local clone.

dmd.errors

Functions for raising errors.
Authors:
Walter Bright
License:
Boost License 1.0

Sourceerrors.d

Documentationhttps://dlang.org/phobos/dmd_errors.html

Coveragehttps://codecov.io/gh/dlang/dmd/src/master/compiler/src/dmd/errors.d

enumErrorKind: int;
Constants used to discriminate kinds of error messages.
structDiagnostic;
Represents a diagnostic message generated during compilation, such as errors, warnings, or other messages.
classErrorSinkCompiler:dmd.errorsink.ErrorSink;
Error message sink for D compiler.
enumClassification: Color;
Color highlighting to classify messages
error
for errors
gagged
for gagged errors
warning
for warnings
deprecation
for deprecations
tip
for tip messages
nothrow voiderror(Locloc, const(char)*format, ...);
Print an error message, increasing the global error count.
Parameters:
Locloclocation of error
const(char)*formatprintf-style format specification
...printf-style variadic arguments
nothrow voiderror(const(char)*filename, uintlinnum, uintcharnum, const(char)*format, ...);
Same as above, but takes a filename and line information arguments as separate parameters.
Parameters:
const(char)*filenamesource file of error
uintlinnumline in the source file
uintcharnumcolumn number on the line
const(char)*formatprintf-style format specification
...printf-style variadic arguments
nothrow voiderrorBackend(const(char)*filename, uintlinnum, uintcharnum, const(char)*format, ...);
Callback for when the backend wants to report an error
nothrow voiderrorSupplemental(Locloc, const(char)*format, ...);
Print additional details about an error message. Doesn't increase the error count or print an additional error prefix.
Parameters:
Locloclocation of error
const(char)*formatprintf-style format specification
...printf-style variadic arguments
nothrow voidwarning(Locloc, const(char)*format, ...);
Print a warning message, increasing the global warning count.
Parameters:
Locloclocation of warning
const(char)*formatprintf-style format specification
...printf-style variadic arguments
nothrow voidwarningSupplemental(Locloc, const(char)*format, ...);
Print additional details about a warning message. Doesn't increase the warning count or print an additional warning prefix.
Parameters:
Locloclocation of warning
const(char)*formatprintf-style format specification
...printf-style variadic arguments
nothrow voiddeprecation(Locloc, const(char)*format, ...);
Print a deprecation message, may increase the global warning or error count depending on whether deprecations are ignored.
Parameters:
Locloclocation of deprecation
const(char)*formatprintf-style format specification
...printf-style variadic arguments
nothrow voiddeprecationSupplemental(Locloc, const(char)*format, ...);
Print additional details about a deprecation message. Doesn't increase the error count, or print an additional deprecation prefix.
Parameters:
Locloclocation of deprecation
const(char)*formatprintf-style format specification
...printf-style variadic arguments
nothrow voidmessage(Locloc, const(char)*format, ...);
Print a verbose message. Doesn't prefix or highlight messages.
Parameters:
Locloclocation of message
const(char)*formatprintf-style format specification
...printf-style variadic arguments
nothrow voidmessage(const(char)*format, ...);
Same as above, but doesn't take a location argument.
Parameters:
const(char)*formatprintf-style format specification
...printf-style variadic arguments
aliasDiagnosticHandler = bool delegate(ref const(SourceLoc) location, Color headerColor, const(char)* header, const(char)* messageFormat, __va_list_tag* args, const(char)* prefix1, const(char)* prefix2) nothrow;
The type of the diagnostic handler see vreportDiagnostic for arguments
Returns:
true if error handling is done, false to continue printing to stderr
DiagnosticHandlerdiagnosticHandler;
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.
nothrow voidtip(const(char)*format, ...);
Print a tip message with the prefix and highlighting.
Parameters:
const(char)*formatprintf-style format specification
...printf-style variadic arguments
aliasFatalErrorHandler = bool delegate() nothrow;
The type of the fatal error handler
Returns:
true if error handling is done, false to do exit(EXIT_FAILURE)
FatalErrorHandlerfatalErrorHandler;
The fatal error handler. If non-null it will be called for every fatal() call issued by the compiler.
nothrow voidfatal();
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.
nothrow @safe voidhalt();
Try to stop forgetting to remove the breakpoints from release builds.
nothrow voidunescapeBackticks(ref OutBufferbuf);
Replace double backticks inbuf with a single backtick
enumHIGHLIGHT: ubyte;
Embed these highlighting commands in the text stream. HIGHLIGHT.Escape indicates a Color follows.
Copyright © 1999-2026 by theD Language Foundation | Page generated byDdoc on Fri Feb 20 17:56:14 2026

[8]ページ先頭

©2009-2026 Movatter.jp