www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Function overloading with non-D linkage?

Shouldn't be impossible to overload functions defined with non-D linkage?
(From http://www.digitalmars.com/d/function.html#overloading: «Functions
defined with non-D linkage cannot be overloaded.»)

For example:

/******************************************************************************/
extern (C) int print(char c) {
	return printf("%c", c);
}

extern (C) int print(char* s) {
    return printf("%s", s);
}

void main() {
    print(cast(char*) "test\n\0");
}
/******************************************************************************/

The compiler accepts that ("dmd -c test.d") even though there will be errors
when linking.
Jan 12 2007