[Issue 607] toString can't handle char[]
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Nov 27 07:01:48 PST 2006
http://d.puremagic.com/issues/show_bug.cgi?id=607
davidl at 126.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|toString can't handle char[]|toString can't handle char[]
------- Comment #1 from davidl at 126.com 2006-11-27 09:01 -------
The problem is actually the compiler can implicitly cast char[] to char*
then the toString take char[] in without any warnings or error message shown.
but it is dangerous to pass char[] to toString
maybe we don't neet the implicitly cast from char[] to char*
or we need to provide either of the funcs as the following:
char[] toString(char[]s)
{
static assert(`Error use of toString, u can't toString a String`);
}
or
char[] toString(char[]s)
{
return
}
--
More information about the Digitalmars-d-bugs
mailing list