mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 10:38:14 +02:00

function result as a variable, and Delphi/TP-like "using the function name inside the function means a recursive call". In order to prevent confusion, we no longer support the former behaviour since r21817 because the conditions under which one or the other holds are not well defined and it's easier to fix a compiler error then to discover why a recursive function call doesn't do anything (mantis #22344) git-svn-id: trunk@24182 -
27 lines
243 B
ObjectPascal
27 lines
243 B
ObjectPascal
{ %fail }
|
|
|
|
program tmacfunret;
|
|
{$MODE MACPAS}
|
|
|
|
procedure B(var x: Integer);
|
|
|
|
begin
|
|
x:= 42;
|
|
end;
|
|
|
|
function A: Integer;
|
|
|
|
begin
|
|
B(A);
|
|
end;
|
|
|
|
var
|
|
i: Integer;
|
|
|
|
begin
|
|
i:= A;
|
|
Writeln(i);
|
|
if i <> 42 then
|
|
halt(1);
|
|
end.
|