ref on hidden this param

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Sun Oct 5 05:45:19 UTC 2025


On 05/10/2025 6:39 PM, TwoOfCups wrote:
> On Sunday, 5 October 2025 at 05:35:24 UTC, Richard (Rikki) Andrew 
> Cattermole wrote:
>> On 05/10/2025 6:28 PM, TwoOfCups wrote:
>> This cannot work.
>>
>> Methods are stored in the vtable which is accessed from the this pointer.
>>
>> You would be jumping to a function pointer which is acquired after a 
>> null dereference.
> 
> ok so mark it final, still i think such a thing would be useful

This is indeed possible.

Walter would like to make the this pointer optionally explicit.

However to support ref on it, there should be reasoning beyond "it could 
be useful".



More information about the Digitalmars-d mailing list