[Issue 271] New: Incorrect constant evaluation of TypeInfo equality comparisons

Thomas Kuehne thomas-dloop at kuehne.cn
Tue Aug 15 05:21:27 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bruno Medeiros schrieb am 2006-08-14:
> Thomas Kuehne wrote:
>> http://dstress.kuehne.cn/run/t/typeid_90_G.d

for reference the test was:
#
# assert(typeid(typeof(typeid(int) == typeid(int))).toString() 
#   == typeid(typeof(args[0].length == args.length)).toString());
#

> I don't think this test case is correct. You test the type-of a TypeInfo 
> (which is an Object) equality operation vs the type-of an int(which is a 
> primitive type) equality operation. Nothing says that such type-of 
> should be the same (even though I very much think it should).
>
> What I do think is not correct is the following (second line) :
>
> writefln( typeid(typeof(typeid(int) == typeid(char))) );// int
> writefln( typeid(typeof(typeid(int) == typeid(int))) );//bool INCORRECT?
> writefln( typeid(typeof(new Object == new Object)) ); // int
>
> writefln( typeid(typeof(typeid(int) != typeid(char))) ); // bool
> writefln( typeid(typeof(typeid(int) != typeid(int))) );  // bool
> writefln( typeid(typeof(new Object != new Object)) ); // bool

See new issue tracker:
http://d.puremagic.com/issues/show_bug.cgi?id=288

Thomas


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

iD8DBQFE4cjWLK5blCcjpWoRAqqdAJoD3bFNsF7172YrvL5GmDB9KfBQkACgrNHF
5ltSQGIWN5RhPLUmIXjTNOI=
=f3zJ
-----END PGP SIGNATURE-----



More information about the Digitalmars-d-bugs mailing list