浏览代码

* Another strange delphi procvar thingy, this time with assigned()

peter 23 年之前
父节点
当前提交
d393a6f1cb
共有 1 个文件被更改,包括 19 次插入0 次删除
  1. 19 0
      tests/tbs/tb0430.pp

+ 19 - 0
tests/tbs/tb0430.pp

@@ -0,0 +1,19 @@
+{$ifdef fpc}{$mode delphi}{$endif}
+
+function f1:pointer;
+begin
+  result:=nil;
+end;
+
+var
+  func: function:pointer;
+begin
+  func:=f1;
+  { Assigned() works on the procvar and does not
+    call func }
+  if not assigned(func) then
+   begin
+     writeln('ERROR!');
+     halt(1);
+   end;
+end.