www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Call to immutable method during immutable construction

Hi,

according to TDPL p. 294 the following call to fun should not be
allowed. But it compiles and I see not why that shouldn't be allowed. I think
it's a bug in TDPL but I'm unsure.

class A {
    int a;
    int[] b;
    this() immutable {
        a = 5;
        b = [ 1, 2, 3 ];
        fun();
    }
    void fun() immutable {
    }
}

Any opinions?

Jens
Nov 10 2010