Thread overview |
---|
September 05, 2005 unittest and compiling | ||||
---|---|---|---|---|
| ||||
<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 Re: unittest and compiling | ||||
---|---|---|---|---|
| ||||
Posted in reply to ElfQT | 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 Re: unittest and compiling | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dave | 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 |
Copyright © 1999-2021 by the D Language Foundation