Bug in Record Static Class Constructor
Original Reporter info from Mantis: Xor-el
-
Reporter name: Ugochukwu Mmaduekwe
Original Reporter info from Mantis: Xor-el
- Reporter name: Ugochukwu Mmaduekwe
Description:
If a record is initialized in a static class constructor and assigned to another in a normal constructor, the result of reference types assigned in the constructor eg( string, classes, arrays etc) gets set to their default state eg( string = '', class = Nil, dynamic array = Nil).
it seems at the exit of the static class constructor, the assigned values are not retained and the record content that are reference types are reset.
This is similar to this issue reported here https://bugs.freepascal.org/view.php?id=33006.
Steps to reproduce:
Just compile and run the attached code
Additional information:
This was tested on Windows 10
Expected Result in accordance to Delphi is
5
fish
3
5
fish
3
while Lazarus 1.9.0 r57316 FPC 3.1.1 x86_64-win64-win32/win64 gives
5
fish
3
5
0
Mantis conversion info:
- Mantis ID: 33205
- Build: r57316
- Version: 3.1.1
- Fixed in version: 3.1.1
- Monitored by: » Xor-el (Ugochukwu Mmaduekwe)