function pointer bug?

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 27 16:13:53 PDT 2014


On Mon, 27 Oct 2014 22:17:24 +0000
bitwise via Digitalmars-d <digitalmars-d at puremagic.com> wrote:

> I have been trying to build a reflection system over the last few
> weeks, and noticed different incarnations of this problem several
> times:
> 
> &(__error).instanceMethod
this means that something gone wrong in the process. '(__error)' is the
"pseudotype" for failed CTFE/instantiation.

> This error seems like it may be related some how:
> 
> enum index = __traits(getVirtualIndex, TestClass.instanceMethod);
> enum p = TestClass.classinfo.vtbl[index];
> 
> The above code will produce this error:
> Error: typeid(main.TestClass).vtbl is not yet implemented at
> compile time
> 
> but if this is the problem, shouldn't Both of the test cases fail?
why? everything is ok here. you can get method index in compile-time,
but there is no built VMT in compile time. what do you want to achieve
with second enum?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141028/7c76cdc2/attachment.sig>


More information about the Digitalmars-d mailing list