Managed field of record not initialized
Original Reporter info from Mantis: Stefan Glienke
-
Reporter name: Stefan Glienke
Original Reporter info from Mantis: Stefan Glienke
- Reporter name: Stefan Glienke
Description:
It seems that a managed field of a record is not initialized if it comes after a class property that returns the record type itself.
Steps to reproduce:
The following code prints FAIL instead of PASS
program project1;
type
TMyRecord = record
private
class function GetEmpty: TMyRecord; static;
public
class property Empty: TMyRecord read GetEmpty;
private
FData: IInterface;
end;
class function TMyRecord.GetEmpty: TMyRecord; static;
begin
end;
procedure Main(Sender: TObject);
var
v1: TMyRecord;
begin
if v1.FData = nil then
Writeln('PASS')
else
Writeln('FAIL');
end;
begin
Main(nil);
end.
Mantis conversion info:
- Mantis ID: 30357
- OS: 8.1
- Platform: Windows
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: 34088 (#54b6cacf)