mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 08:18:12 +02:00
39 lines
925 B
ObjectPascal
39 lines
925 B
ObjectPascal
type
|
|
TSimpleEnum = (seOne, seTwo);
|
|
TSimpleSet = set of TSimpleEnum;
|
|
|
|
TRecordWithSet = record
|
|
TheSet : TSimpleSet;
|
|
end;
|
|
|
|
function FirstFunc:TRecordWithSet;
|
|
begin
|
|
FirstFunc.TheSet := [];
|
|
|
|
//below would work fine
|
|
//FirstFunc.TheSet := FirstFunc.TheSet + [seOne];
|
|
|
|
//below line causes error "Fatal: Internal error 200405022"
|
|
Include(FirstFunc.TheSet, seOne);
|
|
if not(seOne in FirstFunc.TheSet) then
|
|
halt(1);
|
|
end;
|
|
|
|
//absolute variable overlaying Result doesn't help
|
|
function SecondFunc:TRecordWithSet;
|
|
var
|
|
LocalAbs : TRecordWithSet absolute SecondFunc;
|
|
begin
|
|
LocalAbs.TheSet := [];
|
|
//below line would cause same error
|
|
Include(LocalAbs.TheSet, seOne);
|
|
if not(seOne in LocalAbs.TheSet) then
|
|
halt(1);
|
|
end;
|
|
|
|
var
|
|
Collected : TRecordWithSet;
|
|
begin
|
|
Collected := FirstFunc;
|
|
end.
|