digitalmars.D - Attack of the implicit convertion
- Julio César Carrascal Urquijo (13/13) Jul 26 2005 The following code produces an unexpected compile error:
- Ba Ding Chee (2/9) Jul 26 2005 Well is kinda sounds right, complex numbers are twice as big as reals an...
- Jarrett Billingsley (5/12) Jul 27 2005 This error message is quite confusing. It's because there is no toStrin...
The following code produces an unexpected compile error: private import std.string; void main() { std.string.toString(cast(dchar)'a'); } test1.d(135): function std.string.toString called with argument types: (dchar) matches both: std.string.toString(char) and: std.string.toString(creal) ¿creal? ¿Why does it match creal?
Jul 26 2005
test1.d(135): function std.string.toString called with argument types: (dchar) matches both: std.string.toString(char) and: std.string.toString(creal) ¿creal? ¿Why does it match creal?Well is kinda sounds right, complex numbers are twice as big as reals and have the letter ‘i's in them. ;)
Jul 26 2005
"Julio César Carrascal Urquijo" <Julio_member pathlink.com> wrote in message news:dc719n$1th5$1 digitaldaemon.com...test1.d(135): function std.string.toString called with argument types: (dchar) matches both: std.string.toString(char) and: std.string.toString(creal) ¿creal? ¿Why does it match creal?This error message is quite confusing. It's because there is no toString() overload for wchar or dchar. You have to cast to char to use toString. I don't really get why it thinks creal is a match, though.
Jul 27 2005