null matches typed pointers before void pointers

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu May 24 05:50:38 PDT 2012


I'm not sure if this is a bug or not:

struct Foo { }

void test(void* test) { assert(0); }
void test(Foo* test)  { }

void main()
{
    test(null);
}

The call matches the second overload: "void test(Foo* test)". But
shouldn't this be an ambiguous call?


More information about the Digitalmars-d-learn mailing list