You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
interface A
{
import std.meta : AliasSeq;
alias a = AliasSeq!(__traits(getMember, B, "foo"));
void foo();
}
class B : A
{
void foo() { }
}
Gives this error message:
Error: class `B` interface function void foo() is not implemented
The text was updated successfully, but these errors were encountered:
I'd prefer it to work. This is essentially the use case:
interface A
{
import std.traits;
static foreach (e; __traits(derivedMembers, B)) {
static foreach (fn; MemberFunctionsTuple!(B, e)) {
mixin("@(__traits(getAttributes, fn)) ReturnType!fn "~e~"(Parameters!fn);");
}
}
}
class B : A
{
void foo() { }
}
That is, we generate an interface based on a type, and derive that type from said interface. Since derivedMembers doesn't look at base classes and interfaces, this could possibly be made to work.
Related forum discussion:
https://forum.dlang.org/post/dgzojfdiwsssflbnkwtk@forum.dlang.org
Simen Kjaeraas reported this on 2018-05-30T08:39:34Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=18915
Description
interface A { import std.meta : AliasSeq; alias a = AliasSeq!(__traits(getMember, B, "foo")); void foo(); } class B : A { void foo() { } } Gives this error message: Error: class `B` interface function void foo() is not implementedThe text was updated successfully, but these errors were encountered: