Dnia 12-12-2009 o 15:00:56 div0 <[email protected]> napisał(a):
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Tomek Sowiñski wrote:
Dnia 12-12-2009 o 13:09:49 Tomek Sowiñski <[email protected]> napisa³(a):
Error: no constructor for __anonclass10
This one seems to be unrelated to anonymous stuff.
class M {
this(byte a) { _a = a; }
byte _a;
byte a() { return _a; };
static m = new M(3);
}
I get: Error: no constructor for M.
Tomek
Well for this one, you're doing it wrong. You want:
class M {
this(byte a) { _a = a; }
byte _a;
byte a() { return _a; };
static M m;
static this() {
m = new M(3);
}
}
So it's the same when I get the "non-constant expression..." error and
have to put in static ctors? Then what's with the "no constructor for M"?
Tomek