fpc/tests/webtbs/tw41052.pp
florian d147488133 * partly revert 8cd6606970, resolves #41052
(cherry picked from commit 854d4e6f4a5b53040160f8921d0089167f6b00be)
2024-12-23 14:27:48 +01:00

27 lines
472 B
ObjectPascal

program project2;
{$mode objfpc}
{$inline on}
function Func1(S: PAnsiChar): SizeUInt;
begin
Result := 0;
end;
function Func2(S: PAnsiChar): SizeUInt; inline;
begin
Result := Func1(S);
if S <> nil then S[Result] := #0;
end;
function Func3(S: PAnsiChar): SizeUInt; inline;
begin
Result := Func1(S);
if Assigned(S) then S[Result] := #0;
end;
begin
Func2(nil); // <-- OK
Func3(nil); // <-- Error: Incompatible types: got "PAnsiChar" expected "Pointer"
end.