[fpc-pascal] Get TMethod from function reference

Michael Van Canneyt michael at freepascal.org
Thu Sep 8 19:14:08 CEST 2022



On Thu, 8 Sep 2022, Hairy Pixels via fpc-pascal wrote:

>
>
>> On Sep 8, 2022, at 9:09 AM, Michael Van Canneyt <michael at freepascal.org> wrote:
>>
>> To me it seems logical that you cannot do this, since a function reference is actually an
>> interface, and there is no actual object to back it up.
>>
>> Your function reference could also be a regular procedure (no data at all) or even a local
>> procedure.
>
> I thought it keeps the method data in the interface so it could dispatch it later. How would it work otherwise?

It must keep this information somewhere, but this does not mean you can typecast it to a TMethod.

Michael.


More information about the fpc-pascal mailing list