I have done a little experiment, and this code runs:
struct Foo {
int x;
pure int bar(int y) {
return this.x + y;
}
}
void main() {
auto f = Foo(10);
assert(f.bar(7) == 17);
}
So the current D2 implementation works already as in my "half_pure" proposal :o)
I think this can be seen as a bug, but I have not filed it yet.
Bye,
bearophile