www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - disallowed real->complex?

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

http://digitalmars.com/d/changelog.html#new0120
# Complex types can no longer be implicitly converted to non-complex
# types.
# Real and imaginary types can no longer be implicitly converted to each
# other.

Both lines should compile.
#
# cdouble a = 22.0;		// fails
# cdouble a = 22.0+0.0i;	// compiles
#

The conversion real->complex is still allowed.

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

Thomas


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

iD8DBQFCVEn03w+/yD4P9tIRAtSGAKCQQqJoC97Ee+/Et9Y4gHDoSGxKnACePccE
LRlcSyZSO1XBqYAxSNd5Krg=
=GSCW
-----END PGP SIGNATURE-----
Apr 06 2005
parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
Thomas Kuehne wrote:
<snip>
 Both lines should compile.
 #
 # cdouble a = 22.0;		// fails
 # cdouble a = 22.0+0.0i;	// compiles
 #
 
 The conversion real->complex is still allowed.

Did you test imaginary->complex as well? Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Apr 07 2005
parent Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stewart Gordon schrieb am Thu, 07 Apr 2005 13:29:27 +0100:
 Thomas Kuehne wrote:
<snip>
 Both lines should compile.
 #
 # cdouble a = 22.0;		// fails
 # cdouble a = 22.0+0.0i;	// compiles
 #
 
 The conversion real->complex is still allowed.

Did you test imaginary->complex as well?

Doesn't work either http://dstress.kuehne.cn/run/creal_22.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCVTj33w+/yD4P9tIRAslIAJ42ISxNbqVDTDTnqAzgOg68w3B46QCgiGIH TBfoUkOBCarq0JZZMps4rrw= =17Ln -----END PGP SIGNATURE-----
Apr 07 2005