NonNull

When a field is marked with @NonNull, field !is null is asserted.

struct NonNull

Examples

class Class
{
    @NonNull
    Object obj_;

    this(Object obj)
    {
        this.obj_ = obj;
    }

    mixin(GenerateInvariants);
}

(new Class(null)).shouldThrow!AssertError;

Meta