Tomek Sowiñski Wrote:

> Weird: if I reverse the situation -- the object is immutable and function is 
> ordinary -- I also get an error.
> 
> struct A {
>     float _pole;
>     float pole() {
>         return _pole;
>     }
> }
> 
> void main() {
>     immutable A a;
>     auto x = a.pole;   // Ouch!
> }
> 
> Error: function hello.A.pole () is not callable using argument types ()

Sorry, scratch that. The compiler tripped correctly; pole() could've altered 
its object through "this" (the error message could be clearer, though).

So only my root post needs explaining.

Reply via email to