View source code
Display the source code in dmd/func.d from which this page was generated on github.
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 using local clone.

Struct dmd.func.AttributeViolation

Stores a reason why a function failed to infer a function attribute like @safe or pure

struct AttributeViolation ;

Has two modes: - a regular safety error, stored in (fmtStr, arg0, arg1) - a call to a function without the attribute, which is a special case, because in that case, that function might recursively also have a AttributeViolation. This way, in case of a big call stack, the error can go down all the way to the root cause. The FunctionDeclaration is then stored in arg0 and fmtStr must be null.

Fields

NameTypeDescription
arg0 RootObjectArguments for up to two %s format specifiers in format string
arg1 RootObjectArguments for up to two %s format specifiers in format string
arg2 RootObjectArguments for up to two %s format specifiers in format string
fmtStr const(char)*printf-style format string
loc Loclocation of error

Authors

Walter Bright

License

Boost License 1.0