July 08, 2002
module error10;

void main()
{



}

unittest
{
	import string; // Why this is not allowed
}

July 08, 2002
module error11;

void main()
{

	char s;

	debug(5)
	{
		import string;	// Why this is not allowed ?
	}

}
July 09, 2002
"Juarez Rudsatz" <juarez@correio.com> wrote in message news:Xns924588673AA44juarezcom@63.105.9.61...
> module error8;
>
> void main()
> {
>
> char[] s;
>
> s = '';
>
> // Error message to ugly
> switch(s)
> {
> case 'a' : return;
> case 'b' : return;
> }
>
> }

I know this is not the error your testing for, so shouldn't the switch
include a "default:"?
Or was that the error you were testing?


July 11, 2002
Thanks for posting these. I need to evaluate them. -Walter

"Juarez Rudsatz" <juarez@correio.com> wrote in message news:Xns9245878B789B2juarezcom@63.105.9.61...
>
> module erro1;
>
> import c.stdio;
>
> void main(){
>
> // First error : comparing strings with slices
> char[] s = '1234';
>
> printf(s[0..3] ~ \n);
>
> if ('124' == s[0..3])
> printf('Test 1');
> else
> if ('123' == s[0..3])
> printf('Test 2');
> else
> if ('124' === s[0..3])
> printf('Test 3');
> else
> if ('123' === s[0..3])
> printf('Test 4');
> else
> printf('Failed');
>
> // second error : constant string permited in if
>
> if ('value')
> printf(\n'Test 5'\n);
>
> // next error : semicollon list permited in if
> if ('value' , s[1..2], 987)
> printf('Test 6'\n);
>
>
> // Last error : switch with no case allowed
> switch(s){
> default:
> }
>
> }


July 12, 2002
"Juarez Rudsatz" <juarez@correio.com> wrote in message news:Xns924587ABC5488juarezcom@63.105.9.61...
> module error2;
>
> import c.stdio;
>
> void main()
> {
>
> // -> D outputs strings in ASCII codepage and not ANSI on windows
>
> printf("Portuguese special chars : áàãâéèêíóõôú" ~\n);
>
> // D outputs \n not as \n\r in Windows
>
> printf("Execute this program and redirect to a file:\n error >
> output.txt");
>
> }


July 12, 2002
"Juarez Rudsatz" <juarez@correio.com> wrote in message news:Xns924587ABC5488juarezcom@63.105.9.61...
> module error2;
>
> import c.stdio;
>
> void main()
> {
>
> // -> D outputs strings in ASCII codepage and not ANSI on windows

All it does is output to C's stdout.


> printf("Portuguese special chars : áàãâéèêíóõôú" ~\n);
>
> // D outputs \n not as \n\r in Windows

It should output \r\n.

>
> printf("Execute this program and redirect to a file:\n error >
> output.txt");
>
> }


July 19, 2002
It would be dead code. I suppose it could be considered an error, but it might be rather annoying because code under development frequently has functions never called, etc.

"Juarez Rudsatz" <juarez@correio.com> wrote in message news:Xns924587E2E7E7Ejuarezcom@63.105.9.61...
> module error4;
>
> class Xyz
> {
> private void SetParam(char[] option)
> {
> // no call for SetParam must be a error ?
> }
>
> }
>
> void main()
> {
>
> }
>


July 25, 2002
Yes, it's valid code.

"Juarez Rudsatz" <juarez@correio.com> wrote in message news:Xns9245882B11F8Bjuarezcom@63.105.9.61...
> module error12345;
>
> // The module stament could be ommited or wrong typed.
> // Is this right ?
>
> void main()
> {
>
> }


July 25, 2002
On Mon, 8 Jul 2002 16:19:30 +0000 (UTC) Juarez Rudsatz <juarez@correio.com> wrote:

> // Is this right ?
> 
> void main()
> {
> 
> }

Just a note: this isn't right, because main() must return int. =)
July 25, 2002
"Pavel Minayev" <evilone@omen.ru> wrote in message news:CFN374624475681829@news.digitalmars.com...
> On Mon, 8 Jul 2002 16:19:30 +0000 (UTC) Juarez Rudsatz
<juarez@correio.com>
> wrote:
>
> > // Is this right ?
> >
> > void main()
> > {
> >
> > }
>
> Just a note: this isn't right, because main() must return int. =)


It's the same as with C/C++...
Walter, I think you should forbid this,
It's lazy coding. Just do this:

int main()
{
    return 0;
}

That is the way it is supposed to be.

--
Stijn
OddesE_XYZ@hotmail.com
http://OddesE.cjb.net
_________________________________________________
Remove _XYZ from my address when replying by mail