mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-12 19:49:31 +02:00
31 lines
492 B
ObjectPascal
31 lines
492 B
ObjectPascal
{ %FAIL }
|
|
|
|
program tw40725;
|
|
|
|
{$mode delphi}
|
|
{$ModeSwitch functionreferences}
|
|
|
|
type
|
|
TMyProc = reference to procedure(const A: Integer; const B: string);
|
|
TMyProcArray = array of TMyProc;
|
|
|
|
function GetArray: TMyProcArray;
|
|
procedure MyProc(const A: TObject);
|
|
begin
|
|
|
|
end;
|
|
begin
|
|
//Result := [MyProc]; // compiler error -> OK
|
|
Result := Result + [MyProc]; // NO COMPILER ERROR -> BUG
|
|
end;
|
|
|
|
var
|
|
A: TMyProcArray;
|
|
P: TMyProc;
|
|
begin
|
|
A := GetArray;
|
|
for P in A do
|
|
P(1, '');
|
|
end.
|
|
|