A non-nullable type is basically just: struct NotNull(T) { T _payload; alias _payload this; invariant() { assert(_payload !is null); } }
If we could disable the default constructor, this approach might just work. Sure, the checks here would be at runtime, but you'd have them without having to manually write the assert each time. (Though, having to write NotNull! each time isn't that much of a gain over the asserts, but maybe it would help.)