[Issue 22879] New: super call ignores overload in mixin
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Mar 12 10:34:54 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22879
Issue ID: 22879
Summary: super call ignores overload in mixin
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: tim.dlang at t-online.de
import std.stdio;
class A
{
void f(){ writeln("A.f"); }
}
class B: A
{
alias f = A.f;
mixin X!();
}
mixin template X()
{
override void f(){ writeln("B.f"); super.f(); }
}
class C: B
{
override void f(){ writeln("C.f"); super.f(); }
}
void main()
{
(new C).f();
}
The above code prints the following:
C.f
A.f
Instead the following would be expected:
C.f
B.f
A.f
This affects DMD as a library, because ParseTimeTransitiveVisitor uses a mixin
with overloads for visit.
--
More information about the Digitalmars-d-bugs
mailing list