pascalabcnet/TestSuite/nullable14.pas

13 lines
188 B
ObjectPascal
Raw Permalink Normal View History

2023-08-01 21:49:36 +03:00
function f1 := 1;
function p1(n: integer?): integer;
begin
Result := (n??f1).Value;
end;
begin
// OK
assert(p1(nil) = 1);
// AccessViolationException
assert(p1(5) = 5);
end.