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

RazvanN <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #2 from RazvanN <[email protected]> ---
(In reply to Adam D. Ruppe from comment #1)
> 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.

Hmm, to me it seems that you are trying to insert `void foo(int p)` in the same
overload set as `void foo(int)`. Shouldn't this be illegal? Otherwise, once you
call B.foo how can the compiler know which function should be called?

--

Reply via email to