View source code
Display the source code in dmd/func.d from which thispage was generated on github.
Report a bug
If you spot a problem with this page, click here to create aBugzilla 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 usinglocal 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 action - 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.

Fields

NameTypeDescription
action stringAction that made the attribute fail to get inferred
fd FuncDeclarationfunction is the focus of the violation
loc Loclocation of error

Authors

Walter Bright

License

Boost License 1.0