www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - statement.c:651: virtual Statement* ForeachStatement::semantic(Scope*): Assertion 0' failed.

reply Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

foreach_21.d
# int main(){
#        char[] string;
#        foreach(int c, char c; string){
#        }
#        return 0;
# }

 dmd -c foreach_21.d
 dmd: statement.c:651: virtual Statement*
 ForeachStatement::semantic(Scope*): Assertion `0' failed.
 Aborted

test cases: http://svn.kuehne.cn/dstress/nocompile/foreach_21.d http://svn.kuehne.cn/dstress/nocompile/foreach_22.d Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.9.13 (GNU/Linux) iD8DBQFBt+z33w+/yD4P9tIRAhP/AJwJPzjMV+vf4R1Br14x4xb2zeT6CQCgvr6c t8VNxa4GvnSSoDRkDDprzZk= =1UAB -----END PGP SIGNATURE-----
Dec 08 2004
parent Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ERROR -> XFAIL
http://svn.kuehne.cn/dstress/nocompile/foreach_21.d
http://svn.kuehne.cn/dstress/nocompile/foreach_22.d


diff -ur dmd-0.109/dmd/src/dmd/statement.c dmd-neu/dmd/src/dmd/statement.c
- --- dmd-0.109/dmd/src/dmd/statement.c	2004-12-02 02:08:22.000000000 +0100
+++ dmd-neu/dmd/src/dmd/statement.c	2004-12-15 14:35:15.896230952 +0100
   -648,7 +648,7   
 		}
 		var->semantic(sc);
 		if (!sc->insert(var))
- -		    assert(0);
+		    error("foreach: name %s is already defined in parameter list",
var->toChars());
 
 		if (dim == 2 && i == 0)
 		    key = var;



-----BEGIN PGP SIGNATURE-----

iD8DBQFBwD5C3w+/yD4P9tIRAvG0AKCwXMYMAPFdXR8an7cM2JhmzrMA/gCg0Plt
xdW2Oi07k7Y5nMdxysR/sPw=
=iHtc
-----END PGP SIGNATURE-----
Dec 15 2004