[fpc-devel] Interface usage causes FPC to crash

Graeme Geldenhuys graeme at geldenhuys.co.uk
Wed Nov 28 16:12:09 CET 2012


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 -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.pas
Type: text/x-pascal
Size: 1743 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20121128/55a59356/attachment.pas>


More information about the fpc-devel mailing list