NonNull

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

public
struct NonNull

Examples

class Class
{
    @NonNull
    Object obj_;

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

    mixin(GenerateInvariants);
}

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

Meta