Interface delegation to members of type TObject (instead of Interface) compiles but crashes at runtime
Original Reporter info from Mantis: gerrit
-
Reporter name: Gerrit Moeller
Original Reporter info from Mantis: gerrit
- Reporter name: Gerrit Moeller
Description:
Delegating Interface methods to a member variable of type TObject instead of Interface compiles but crashes at runtime.
Looks like the code is not prepared for this. Then the compiler should reject such code.
The element etFieldValue in TInterfaceEntryType may need to be split into etObjFieldValue and etIntfFieldValue to support this.
Steps to reproduce:
Compile and run attached IntfDelegationCrash.pas
Mantis conversion info:
- Mantis ID: 19180
- OS: All
- OS Build: All
- Platform: All
- Version: 2.4.2
- Fixed in version: 2.6.0
- Monitored by: » luizamerico (Luiz Americo)