matching overloaded functions (std.string.toString)
rmann-d-lang at latencyzero.com
Sat Feb 3 12:55:46 PST 2007
I'm not sure I understand the matching rules for overloaded functions. I have a type:
typedef int OSStatus;
and I want to call
but I get these errors:
function std.string.toString called with argument types:
It more readily matches toString(int). I realize the spec says that if a match is ambiguous, then it's an error, but it sure would be nice if this worked.
So, I tried defining my own toString(OSStatus):
return std.string.toString(cast (int) inVal);
But I get the same error.
Can someone tell me why? Surely an exact match would be acceptable. Thanks!
More information about the Digitalmars-d-learn