fpc/tests/test/tblock1.pp
Jonas Maebe c730e16031 * changed the syntax for block procvars from "xxx is block" to
"reference to ...; cdecl;". The "reference to ..." syntax is what Delphi
    uses for anonymous function references. The "cdecl;" indicates that this
    is for the C-variant of such references, which is what blocks are

git-svn-id: branches/blocks@28233 -
2014-07-18 09:15:29 +00:00

32 lines
344 B
ObjectPascal

{ %target=darwin,iphonesim}
{$modeswitch blocks}
type
tblock = reference to procedure; cdecl;
procedure test(b: tblock);
begin
b;
end;
procedure proc;
begin
writeln('called as block');
end;
const
bconst: tblock = @proc;
var
b: tblock;
begin
b:=@proc;
b;
test(@proc);
test(b);
bconst;
test(bconst);
end.