tim: > So now D isn't the only OOP language with an immutability system:
This page: http://old.nabble.com/Could-proved-immutable-classes-be-added-to-Scala--td14626792.html Says: >* Any class that extends an immutable class must be immutable This seems true in D too: immutable class Foo { int x; this(int xx) { this.x = xx; } } class Bar : Foo { int y; this(int xx, int yy) { super(xx); this.y = yy; } } void main() { auto b = new Bar(1, 2); b.y = 10; // Error } But you can omit the immutable annotation in Bar, so nowhere it's written that y too is immutable. I think this is bad, worth fixing (Bar or y have to be annotated with immutable). Bye, bearophile
