Use a different type to match empty slice instead of void[]?
struct ArrayWrapper(T) { T t; this(T t) { assert(t !is null); } @disable this(typeof(null)); @disable this(ArrayWrapper[]); //should match [] typeof(this) opAssign(T val) { assert(t !is null); this.t = val; return this; } @disable typeof(this) opAssign(typeof(null));@disable typeof(this) opAssign(ArrayWrapper[]); //should match []
}