Interface delegate class - incompatible with Delphi
Original Reporter info from Mantis: ggeldenhuys
-
Reporter name: Graeme Geldenhuys
Original Reporter info from Mantis: ggeldenhuys
- Reporter name: Graeme Geldenhuys
Description:
See attached test project. Trying to compile this project as-is, will fail under FPC with the following "does not implement interface" error:
------------------------
Free Pascal Compiler version 2.7.1-rUnversioned directory [2012/11/15] for x86_64
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling test.pas
test.pas(65,76) Error: Class "TMyIntfClass" does not implement interface "IMyIntf"
Fatal: Compilation aborted
An unhandled exception occurred at $0000000000564D25:
EAccessViolation: Access violation
$0000000000564D25
------------------------
Yet, that same code compiles just fine under Delphi 7. In Delphi the delegate class is not required to mention the interfaces in the class definition.
Swapping lines 41 & 42 allows you to compile under FPC with CORBA interfaces. Thus you are forced under FPC to declare the interfaces in the class definition.
Using compiler mode 'objfpc' or 'delphi' doesn't make a difference here either.
Mantis conversion info:
- Mantis ID: 23403
- OS: Linux OpenSUSE
- OS Build: 12.2
- Platform: x86_64
- Version: 2.7.1
- Monitored by: » luizamerico (Luiz Americo)