Thread overview
unittest and compiling
Sep 05, 2005
ElfQT
Sep 06, 2005
Dave
Sep 06, 2005
ElfQT
September 05, 2005
<code>
private import std.stdio;

int main(char[][] args)
{
 return 0;
}

unittest
{
 float f = 1.0f;
 char[] c = toString(f);
}
</code>

<compiling>
dmd.exe test.d
 -> OK

dmd.exe test.d -unittest
Unittest.d(11): undefined identifier toString
Unittest.d(11): function expected before (), not toString of type int
Unittest.d(11): cannot implicitly convert expression (toString(f)) of type
int to char[]
</compiling>


September 06, 2005
You need to import std.string too.

In article <dfij6n$2n20$1@digitaldaemon.com>, ElfQT says...
>
><code>
>private import std.stdio;
>
>int main(char[][] args)
>{
> return 0;
>}
>
>unittest
>{
> float f = 1.0f;
> char[] c = toString(f);
>}
></code>
>
><compiling>
>dmd.exe test.d
> -> OK
>
>dmd.exe test.d -unittest
>Unittest.d(11): undefined identifier toString
>Unittest.d(11): function expected before (), not toString of type int
>Unittest.d(11): cannot implicitly convert expression (toString(f)) of type
>int to char[]
></compiling>
>
>


September 06, 2005
Doh, I forgot that, when I tried to near down a reproduce the error with a
small example.
The real error is still mine: I've tried to mixin a template, where the
template was in another file. And std.string was private in the referred
file containing the template also not imperted in the file trying to mixin.
Thanks,
ElfQT