digitalmars.D.bugs - Typeid for functions
- tetsuya (11/11) May 20 2005 DMD0.124, winXP.
- Burton Radons (7/18) May 22 2005 Delegates and function pointer typeinfos presently include just their
- tetsuya (2/11) May 23 2005 Thanks. I'll keep that in mind.
- =?ISO-8859-1?Q?Thomas_K=FChne?= (26/26) Jun 04 2005 -----BEGIN PGP SIGNED MESSAGE-----
DMD0.124, winXP. The following code prints "int()*". Shouldn't it be "int(int)*" ? The same occurs on delegates too. <code> import std.stdio; void main() { writefln(typeid(int function(int))); } </code> -tetsuya
May 20 2005
tetsuya wrote:DMD0.124, winXP. The following code prints "int()*". Shouldn't it be "int(int)*" ? The same occurs on delegates too.Delegates and function pointer typeinfos presently include just their return value and no arguments. If you're trying to compare TypeInfos, then you need to use "is"; their opEquals is currently broken and will return equivalence between ANY function pointer, even with different return types. I sent fixes for that to Walter a few versions ago - I'm not sure what he's doing with them.<code> import std.stdio; void main() { writefln(typeid(int function(int))); } </code>
May 22 2005
In article <d6qkb0$2chg$1 digitaldaemon.com>, Burton Radons says...tetsuya wrote:Thanks. I'll keep that in mind.[snip]Delegates and function pointer typeinfos presently include just their return value and no arguments. If you're trying to compare TypeInfos, then you need to use "is"; their opEquals is currently broken and will return equivalence between ANY function pointer, even with different return types. I sent fixes for that to Walter a few versions ago - I'm not sure what he's doing with them.[snip]
May 23 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 tetsuya wrote: | DMD0.124, winXP. | | The following code prints "int()*". Shouldn't it be "int(int)*" ? | The same occurs on delegates too. | | <code> | import std.stdio; | void main() | { | writefln(typeid(int function(int))); | } | </code> | Extended test cases: http://dstress.kuehne.cn/run/typeid_84.d http://dstress.kuehne.cn/run/typeid_85.d Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (MingW32) iD8DBQFCoed23w+/yD4P9tIRAtQGAKC3LKseEpc2GOhrhawOQz4Xpk2xiwCeM9Uz v8Dn2ExqvKOzJM/w55DF7w4= =PQG7 -----END PGP SIGNATURE-----
Jun 04 2005