[fpc-pascal] Traits Proposal

Ryan Joseph genericptr at gmail.com
Sun Feb 14 19:07:47 CET 2021



> On Feb 14, 2021, at 9:55 AM, Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
> 
> No, interfaces by *themselves* don't mean that. An interface instance is merely a shifted Self pointer that points to the static VMT of which the entries correct the Self pointer again upon the method call. This can be seen in GetInterfaceByEntry in rtl/inc/objpas.inc (the core function dealing with the casting of class to interface).

Remind me again, what happens when you cast a class to an interface? It's a runtime check with GetInterfaceByEntry?

Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list