BetterC Bug? Intended Behavior? Asking Here As Unsure
Kayomn
kayomn at kayomn.net
Mon Jul 6 20:06:51 UTC 2020
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
More information about the Digitalmars-d-learn
mailing list