+ test from Rika for merge request 458

This commit is contained in:
florian 2023-08-14 23:21:25 +02:00
parent dde19c0144
commit cc27a5de78

32
tests/tbs/tb0707.pp Normal file
View File

@ -0,0 +1,32 @@
{$mode objfpc} {$modeswitch advancedrecords}
var
initialized: boolean = false;
type
InnerRec = record
class operator Initialize(var self: InnerRec);
end;
OuterRec = record
inner: InnerRec;
class operator Initialize(var self: OuterRec);
end;
class operator InnerRec.Initialize(var self: InnerRec);
begin
initialized := true;
end;
class operator OuterRec.Initialize(var self: OuterRec);
begin
end;
begin
Initialize(OuterRec(nil^));
if not initialized then
begin
writeln('Inner record not initialized.');
halt(1);
end;
writeln('ok');
end.