www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - bug, pointers and boolean expressions

reply "Tintor Marko" <tm030127d galeb.etf.bg.ac.yu> writes:
code (equalR returns bool)
-----
bool equal(X* a, X* b)
{
return (!a || !b) ? !a && !b : equalR(a,b);
}
-----

DMD 0.116 WIN32: cannot implicitly convert expression (!a || !b ? !a && !b  
: cast(int)(equalR(a,b))) of type int to bit
Mar 13 2005
parent =?ISO-8859-15?Q?Thomas_K=FChne?= writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tintor Marko wrote:

| code (equalR returns bool)
| -----
| bool equal(X* a, X* b)
| {
| return (!a || !b) ? !a && !b : equalR(a,b);
| }
| -----
|
| DMD 0.116 WIN32: cannot implicitly convert expression (!a || !b ? !a
| && !b  : cast(int)(equalR(a,b))) of type int to bit

Added to DStress as
http://dstress.kuehne.cn/run/cast_20.d
http://dstress.kuehne.cn/run/cast_21.d

Thomas

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFCNSqj3w+/yD4P9tIRAkv8AKCh7lq2cuK5vG5AlZRav4zgvivH9ACghFDi
apwlswBsTnSp6V3/ezPPGWM=
=xd71
-----END PGP SIGNATURE-----
Mar 13 2005