September 09, 2003 Overload problem | ||||
---|---|---|---|---|
| ||||
Such code used to compile:
void test(char []s,char d) { printf("char\n"); }
void test(char []s,double d) { printf("double\n"); }
void test(char []s,cdouble d) { printf("xdouble\n"); }
int main()
{
double x;
test("test=",x);
return 0;
}
Now the compiler returns:
function test overloads void(char[]s,char d) and void(char[]s,cdouble d) both match argument list
for test
If you remove the parameter s (4x), the code compiles and works as expected.
--
Helmut Leitner leitner@hls.via.at
Graz, Austria www.hls-software.com
|
Copyright © 1999-2021 by the D Language Foundation