Something discovered in the D Language Code Club Discord server with the help of Wild is that the following code:

struct Test { ~this() {} }
void tester(Test test, Test[] tests...) { }

extern(C) void main() {
    tester(Test(), Test());
}

Raises the "TypeInfo cannot be used with ~betterC" error. It seems to be due to an inclusion of both the destructor and the non-vararg and vararg argument matching from testing.

Anyone know a way around this without resulting to the rather hacky solution of just having 1 argument and always assuming that at least 1 argument is present?

Here is a code demo setup for demonstrating the potential problem:
https://run.dlang.io/is/A6oIpl

Reply via email to