Why doesn't this compile? IClassName2 descends from IClassName1 so shouldn't 
TClassName be compatible with IClassName1?

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

{$mode objfpc}
{$interfaces corba}

program test;

type
  IClassName1 = interface
  end;
  IClassName2 = interface(IClassName1)
  end;

type
  TClassName = class(IClassName2)
  end;

procedure Pass(int: IClassName1); 
begin
  
end;

var
  c: TClassName;
begin
  // Incompatible type for arg no. 1: Got "TClassName", expected "IClassName1"
  Pass(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