Hello Tomek,

I've got a problem calling an immutable getter on an "ordinary"
object.

struct A {
float _pole;
float pole() immutable {
return _pole;
}
}
void main() {
A a;
auto x = a.pole;   // Ouch!
}
Error: function hello.A.pole () immutable is not callable using
argument types ()


immutable requiers that the value not be able to change

void main() {
 A a;
 auto x = a.pole;
 a._pole++;
 auto y = a.pole; // pole returns something different than it did last time.
}


Reply via email to