[Issue 22879] super call ignores overload in mixin

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 12 13:39:11 UTC 2022


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

--- Comment #2 from Tim <tim.dlang at t-online.de> ---
(In reply to Adam D. Ruppe from comment #1)
> I expect the alias is there in the real thing because of overloading
> arguments in the real thing right?
Yes, the class ParseTimeTransitiveVisitor overrides some overloads using a
template mixins and uses an alias for other overloads:
https://github.com/dlang/dmd/blob/cbba5f41a32cfed7f22a213d537f8e2dee0b92f7/src/dmd/transitivevisitor.d#L17-L21

> 
> What you actually want to do is to alias BOTH sets together, not just one:
> 
> ```
> class B: A
> {
>     alias f = A.f;
>     alias f = x.f;
>     mixin X!() x;
> }
> ```
> 
> This combines the overloads of A with the overloads of X, thus allowing the
> override to take effect.
Thanks, this works.

> 
> This should probably be closed as not a bug, since it is working as
> designed...
I have now seen, that the same problem was already fixed with the same
workaround for SemanticTimeTransitiveVisitor:
https://github.com/dlang/dmd/pull/7635

I will close this as a duplicate of issue 18132, which was referenced in the
pull request.

--


More information about the Digitalmars-d-bugs mailing list