With latest git dmd:

        auto makeVoldemort(int x) {
                struct Voldemort {
                        @property int value() { return x; }
                }
                return Voldemort();
        }
        void main() {
                auto v = makeVoldemort();
                writeln(v.value);
        }

Compile error:

        test.d(3): Error: function test.makeVoldemort.Voldemort.value cannot 
access frame of function test.makeVoldemort

Changing 'struct' to 'class' works. Is this deliberate, or is it a bug?
It is certainly inconsistent with Walter's article on Voldemort types,
which uses structs as examples.


T

-- 
You have to expect the unexpected. -- RL

Reply via email to