Generic advanced records in FPC mode mess up multiple operator overloading
Original Reporter info from Mantis: Kornel Kisielewicz
-
Reporter name: Kornel Kisielewicz
Original Reporter info from Mantis: Kornel Kisielewicz
- Reporter name: Kornel Kisielewicz
Description:
When we want to implement several arithmetic operators done in delphi style in a generic record, the compiler reports error on generic parse, instead of waiting for the specialization. Hence, a generic Vector 3 can't have both a Vector3 * Vector3 operator and a Vector3 * Scalar one.
We get an error at generic parse :
generic_record_op_bug.pas(8,18) Error: function header doesn't match the previous declaration "operator *(const &LtPos;record type>,const &LtPos;record type>):&LtPos;record type>;"
Steps to reproduce:
Run the attached program.
Mantis conversion info:
- Mantis ID: 21179
- OS: Windows
- OS Build: 7 x64
- Platform: x64
- Version: 2.6.0
- Fixed in version: 3.0.0
- Fixed in revision: 20345 (#2a872978)