mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-11 11:18:17 +02:00

interfaces, even if they only differ in resulttype (mantis #11862) * fixing this required that multiple entries for the same method in a interface vmt are all written out (change in ImplementedInterface.AddImplProc) git-svn-id: trunk@11595 -
58 lines
855 B
ObjectPascal
58 lines
855 B
ObjectPascal
{ %fail }
|
|
|
|
program bug9;
|
|
|
|
{$ifdef fpc}
|
|
{$mode delphi}
|
|
{$endif}
|
|
|
|
|
|
type
|
|
ITest = interface(IInterface)
|
|
['{FE6B16A6-A898-4B09-A46E-0AAC5E0A4E14}']
|
|
function Parent: ITest;
|
|
function GetChild: ITest;
|
|
end;
|
|
|
|
ITestEx = interface(ITest)
|
|
['{82449E91-76BE-4F4A-B873-1865042D5CAF}']
|
|
end;
|
|
|
|
TTest = class(TInterfacedObject, ITest)
|
|
function ITest.Parent = ParentEx;
|
|
{ ITestEx }
|
|
function ParentEx: ITestEx;
|
|
function GetChild: ITest;
|
|
procedure RemoveChild;
|
|
end;
|
|
{ ITest }
|
|
|
|
{ ITestEx }
|
|
|
|
function TTest.ParentEx: ITest;
|
|
begin;
|
|
Result := nil
|
|
end;
|
|
|
|
|
|
|
|
function TTest.GetChild: ITest;
|
|
begin;
|
|
WriteLn('TTest.GetChild');
|
|
Result := nil
|
|
end;
|
|
|
|
procedure TTest.RemoveChild;
|
|
begin;
|
|
WriteLn('TTest.RemoveChild');
|
|
end;
|
|
|
|
|
|
var E: ITest;
|
|
begin
|
|
E := TTest.Create;
|
|
WriteLn('Calling GetChild');
|
|
E.GetChild();
|
|
WriteLn('Stop');
|
|
end.
|