<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Ryan Joseph via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> schrieb am Fr., 10. Juli 2020, 12:04:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br>
<br>
> On Jul 10, 2020, at 12:31 PM, Sven Barth <<a href="mailto:pascaldragon@googlemail.com" target="_blank" rel="noreferrer">pascaldragon@googlemail.com</a>> wrote:<br>
> <br>
> A lookup is only necessary if you use e.g. "SomeClass as SomeIntf".<br>
<br>
so if I do:<br>
<br>
DoSomething(c as IFoo);<br>
<br>
then Supports() is called at runtime to return the IFoo interface? That's the kind of thing I was really curious about, when are runtime checks performed vs compile time checks.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">If you use the "as" or "is" operators it will be runtime checks, otherwise it will be compile time checks. </div><div dir="auto"><br></div><div dir="auto">Also to be pedantic: the operators use the lower level API GetInterfaceByStr not Supports (which uses another low level API). </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>