On Tuesday, 31 July 2018 at 20:40:25 UTC, Steven Schveighoffer wrote:
OK, so one thing to learn in D, you can't hijack stuff. When you override a function, you have to override ALL the overloads.

I could have sworn I tested this before I wrote that it's a bug:

struct A {
    void fun(int) {}
}
struct B {
    A a;
    alias a this;
    @disable void fun(float);
}

void main() {
    B b;
    b.fun(3);
}

I was surprised to see it work, as I also thought it'd be a hijacking issue. Turns out, it doesn't actually work. I must have made a typo when I tried it. Ah well.

--
  Simen

Reply via email to