import std.stdio;

struct State {
string s; string getString() { return s; }
static State opCall(string s) {
State ret;
ret.s = s;
return ret;
}
}

void main() {
auto s = State("adf");
pragma(msg, s.getString());
}

dmd Output: (line 14 is the pragma statement)

struct.d(14): Error: variable s cannot be read at compile time
struct.d(14): Error: cannot evaluate s.getString() at compile time
s.getString()




Rory McGuire
R&D

Tel : +27 (033) 386 7263

Cell : +27 (082) 856 3646
Email: rmcguire@neonova.co.za
Website: www.neonova.co.za
VCard: View
Beta Test Advert
This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of NeoNova. If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone. Please contact the sender if you believe you have received this email in error.