[Issue 23277] New: 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:16:57 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23277
Issue ID: 23277
Summary: alias to mixin template breaks selective overriding of
mixin template member
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: destructionator at gmail.com
Easier to describe in code:
```
interface A {
void foo();
void foo(int);
}
mixin template C(alias impl, Iface) {
void foo(){ return impl.foo(); }
void foo(int p){ return impl.foo(p); }
}
class B : A {
A impl;
mixin C!(impl, A) c;
void foo(int) {}
alias foo = c.foo;
}
```
Error: function `test.B.C!(impl, A).foo(int p)` conflicts with previous
declaration at test.d(14)
This pattern normally works to selectively override a function from the mixin
template, but the circular definition seems to trigger an order of semantic bug
or something.
--
More information about the Digitalmars-d-bugs
mailing list