Less pure for objects

bearophile bearophileHUGS at lycos.com
Thu Apr 29 14:48:52 PDT 2010


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



More information about the Digitalmars-d mailing list