Interface Inheritance Bug
Original Reporter info from Mantis: africanwilddog
-
Reporter name: African Wild Dog
Original Reporter info from Mantis: africanwilddog
- Reporter name: African Wild Dog
Description:
The compiler are not able to recognize interfance inheritance and implementors.
When i try to compile the unit bellow, i get this error:
"interface_bug.pas(41,44) Error: Incompatible types: got "TImplementor" expected "IParentInterface""
Steps to reproduce:
Compile the unit bellow:
== CODE ====
unit interface_bug;
{$mode objfpc}
interface
type
IParentInterface = interface
['{0F78D56E-85A6-4024-98D7-720D7C7B9573}']
procedure Foo;
end;
IChildInterface = interface(IParentInterface)
['{1AB2EB85-6843-462E-8CE4-32ECC065011E}']
procedure Bar;
end;
TImplementor = class(TInterfacedObject, IChildInterface)
public
procedure Foo;
procedure Bar;
end;
var
ParentImplementorInstance: IParentInterface;
implementation
procedure TImplementor.Foo;
begin
end;
procedure TImplementor.Bar;
begin
end;
initialization
ParentImplementorInstance := TImplementor.Create;
end.
===
Mantis conversion info:
- Mantis ID: 31568
- Fixed in version: 3.1.1
- Fixed in revision: 1457 (#9e0cfc60)
- Target version: 3.2.0