Given the code below and the 2 cases can anyone explain what exactly the 
compiler does when the interfaces are assigned to? Does it copy a record like 
structure, call some internal functions, do runtime checks? I'm curious if 
they're doing more than I think they do.

============================

{$mode objfpc}
{$interfaces corba}

program unit_name;

type
  IFoo = interface ['IFoo']
  end;

type
  TMyClass = class (IFoo)
  end;

procedure DoSomething(i: IFoo); 
begin
end;

var
  f: IFoo;
  c: TMyClass;
begin
  // case A
  f := c;
  // case B
  DoSomething(c);
end.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to