> almost zero mainstream (statically typed) programming languages can even let you write down that you want a non-empty string.
Today D will fulfill your dreams!
struct MyString {
private string s = "error";
alias s this;
this(string s) {
assert(s.length);
this.s = s;
}
}
void main() {
MyString ms = "hello";
test(ms);
MyString mserror = ""; // runtime assert fail
}
void test(string s) { }