[Issue 15332] ICE in e2ir.c: assert(irs->sthis) in visit(ThisExp), function literal with keyword 'function' calls method

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Nov 13 17:59:23 PST 2015


https://issues.dlang.org/show_bug.cgi?id=15332

--- Comment #1 from Simon Na. <eiderdaus at gmail.com> ---
Speculation: 'function' doesn't allow to refer to information outside of the
literal's body (here, the 'this' pointer), unlike 'delegate'. Removing the
keyword makes my literal a delegate, which becomes legal D. dmd doesn't notice
the illegal referral to outside information at first, but eventually ends up
with 'this' being a null pointer, failing the assert in e2ir.c.

--


More information about the Digitalmars-d-bugs mailing list