Take the 2-minute tour ×  I asked a similar question about
implicit interface variables not so long ago.  The source of
this question was a bug in my code due to me not being aware of
the existence of an implicit interface variable created by the
compiler. This variable was finalized when the procedure that
owned it finished. This in turn caused a bug due to the lifetime
of the variable being longer than I had anticipated.  Now, I
have a simple project to illustrate some interesting behaviour
from the compiler:  program ImplicitInterfaceLocals;    function
Create: IInterface;   Result := TInterfacedObject.Create;
procedure StoreToLocal;   I: IInterface;   I := Create;
procedure StoreViaPointerToLocal;   I: IInterface;   P:
^IInterface;   P := @I;   P^ := Create;   StoreToLocal is
compiled just as you would imagine. The local variable I, the
function's result, is passed as an implicit var parameter to
Create. The tidy up for StoreToLocal results in a single call to
IntfClear. No surprises there.  However, St