[Issue 23277] alias to mixin template breaks selective overriding of mixin template member

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jul 31 00:19:46 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=23277

--- Comment #1 from Adam D. Ruppe <destructionator at gmail.com> ---
Actually, I don't think I completely reduced this; you can remove the alias
param and still get it by just mentioning `impl` in the body.

This is further reduced:

```
interface A {
        void foo();
        void foo(int);
}

mixin template C() {
        void foo(){ return impl.foo(); }
        void foo(int p){ return impl.foo(p); }
}

class B : A {
        A impl;
        mixin C!() c;
        void foo(int) {}
        alias foo = c.foo;
}
```

The alias line in the class is necessary to trigger the thing.

--


More information about the Digitalmars-d-bugs mailing list