might be a bug in the DMD FrontEnd

Davidl Davidl at 126.com
Thu Mar 29 22:18:49 PDT 2007


i don't see what prevent the following from compiling:
import std.stdio;
char[] ctfe()
{
	wchar[] k=cast(wchar[])"int  
i;/*asdfasf"~cast(wchar[])("adf"~cast(char)100~cast(char)192~cast(char)250)~cast(wchar[])"dsafj*/  
int j;";
	char[] jimmy = cast(char[])(k[0..k.length-1]);
	int i;
	for(i=0;i<jimmy.length;)
	{
		if (jimmy[i]==0)
			jimmy=jimmy[0..i]~jimmy[i+1..jimmy.length];
		else
			i++;
	}
	return jimmy;
	
}
void main()
{
	mixin(ctfe);
	char[] k=ctfe;
         printf ("%s",k.ptr);
}

and by viewing the frontend, i think there might be a bug of slicing  
wchar[] in compile time.
ilwr, iupr ain't taken care of for wchar[] and dchar[] case

Regards,
David Leon



More information about the Digitalmars-d mailing list