Some testing?

bearophile bearophileHUGS at lycos.com
Wed Jul 14 11:55:57 PDT 2010


This small D2 program compiles with no errors:

T foo(T)(T x) {}
void main() {}

But there is no way it can compile, regardless of the type T, because foo()() lacks a return statement. 
So is it possible for the D compiler to perform some sanity tests for the template functions too, to catch a bugs like this one?

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list