Playing around with aliasthis

Rory McGuire via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 26 11:51:25 PST 2016


On Tue, Jan 26, 2016 at 8:20 AM, Rory via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> Hi,
>
> I need some help understanding dmd and I'm wondering where I should ask.
>
> I have made a multiple aliasthis implementation that currently only works
> for structs. If I try to use a class then the compiler segfaults in .
> The implementation basically just changes aggregate.aliasthis to be
> aggregate.aliasthis(Type expectedType) and then that function picks a
> matching aliasthis option and returns it.
>
> Thanks,
> Rory
>


The segfault was because I forgot to mark one of my new methods as "final",
and it was messing with the poffset in baseOf.

I think this is relevant to anyone mixing D and C++, not sure if its for
everyone because I'm not sure where poffset comes from. Basically if a
struct works and a class causes the compiler to segfault in baseOf when
compiling your module, its probably this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20160126/e0cc9752/attachment.html>


More information about the Digitalmars-d mailing list