Hi,
I tested the attached program under Delphi 7 and FPC 2.6.0 and FPC 2.7.1 (dated 2012-11-15).
The test application tests two things:
1) Interface delegation via another class
2) Overriding a interface implementation using method resolution
Under Delphi 7 the test application compiles and runs as expected.
Under FPC (both 2.6.0 and 2.7.1)
- I get a compiler error. I thought interface delegation was supported in FPC?
- I also get a compiler crash with an AV - in both versions.
Isn't interface delegation supported in FPC?
Is method resolution supported in FPC?
Why does the compiler crash while compiling?
----8<-------------8<-------------8<-------------8<-------------8<---- Free Pascal Compiler version 2.6.0 [2011/12/23] for x86_64 Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for x86-64
Compiling test.pas
test.pas(38,76) Error: Class "TMyIntfClass" does not implement interface "IMyIntf"
Fatal: Compilation aborted
An unhandled exception occurred at $000000000054CA3D : EAccessViolation : Access violation
$000000000054CA3D
$0000000000532148
$000000000056CEF4
$000000000042392F
----8<-------------8<-------------8<-------------8<-------------8<----
The expected output when running the test application should be:
---------------------------------------------------------- c:\Programming\test\interface_delegation_2>test
TMyIntfClass.P1
TMainForm.MyP2
----------------------------------------------------------
Regards,
- Graeme -
