www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - TypeInfo.tisize is zero. (bug?)

reply ahiru <ahiru 1dk.jp> writes:
void main() {
// tsize is a member of class TypeInfo. (see also dmd/src/phobos/object.d)
assert(int.sizeof == typeid(int).tsize); // OK
assert(double.sizeof == typeid(double).tsize); // OK
alias void function() func;
assert(typeid(func).sizeof == typeid(func).tsize); // NG (typeid(func).tsize ==
0)
alias int delegate() del;
assert(typeid(del).sizeof == typeid(del).tsize); // NG (typeid(del).tsize == 0)
}

There is not the harm particularly, but it is ...
May not tisize become always equal with sizeof?



---
ahiru >(' )
Feb 28 2005
parent reply ahiru <ahiru 1dk.jp> writes:
In article <d014bu$1rfe$1 digitaldaemon.com>, ahiru says...
void main() {
// tsize is a member of class TypeInfo. (see also dmd/src/phobos/object.d)
assert(int.sizeof == typeid(int).tsize); // OK
assert(double.sizeof == typeid(double).tsize); // OK
alias void function() func;
assert(typeid(func).sizeof == typeid(func).tsize); // NG (typeid(func).tsize ==
0)
alias int delegate() del;
assert(typeid(del).sizeof == typeid(del).tsize); // NG (typeid(del).tsize == 0)
}
mistake... alias void function() func; assert(func.sizeof == typeid(func).tsize); // NG (typeid(func).tsize == 0) alias int delegate() del; assert(del.sizeof == typeid(del).tsize); // NG (typeid(del).tsize == 0) --- ahiru >(' )
Feb 28 2005
parent Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ahiru schrieb am Tue, 1 Mar 2005 07:32:11 +0000 (UTC):
 In article <d014bu$1rfe$1 digitaldaemon.com>, ahiru says...
void main() {
// tsize is a member of class TypeInfo. (see also dmd/src/phobos/object.d)
assert(int.sizeof == typeid(int).tsize); // OK
assert(double.sizeof == typeid(double).tsize); // OK
alias void function() func;
assert(typeid(func).sizeof == typeid(func).tsize); // NG (typeid(func).tsize ==
0)
alias int delegate() del;
assert(typeid(del).sizeof == typeid(del).tsize); // NG (typeid(del).tsize == 0)
}
mistake... alias void function() func; assert(func.sizeof == typeid(func).tsize); // NG (typeid(func).tsize == 0) alias int delegate() del; assert(del.sizeof == typeid(del).tsize); // NG (typeid(del).tsize == 0)
Added to DStress as http://dstress.kuehne.cn/run/typeid_84.d http://dstress.kuehne.cn/run/typeid_85.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCP8/J3w+/yD4P9tIRAo7iAJ9NcjD7A5thuf9veJNCuiK9erKu4wCfZlLx rdUoJdv8hCXzHt6djiz0VuA= =74Nf -----END PGP SIGNATURE-----
Mar 22 2005