Is this a bug?

        class A {
                int method();
        }
        class B : A {
                override void method(int);
        }
        void main() {
                B b;
                b.method(123);          // OK
                int x = b.method();     // NG
        }

One might question the wisdom of this kind of overloading, but this is
an actual use case in Phobos. In std.range.interfaces, we have:

        interface InputRange(E) {
                @property bool empty();
                @property E front();    // N.B. argumentless overload
                void popFront();
        }

        interface InputAssignable(E) : InputRange!E {
                @property void front(E e); // single argument overload
        }

The current shadowing behaviour makes InputAssignable fail to pass
isInputRange, because the derived interface's .front method shadows the
base class's, even though they are non-conflicting overloads(!).


T

-- 
"I'm running Windows '98." "Yes." "My computer isn't working now." "Yes, you 
already said that." -- User-Friendly

Reply via email to