Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
fpc-src / usr / share / fpcsrc / 3.2.0 / tests / webtbs / tw24844b.pp
Size: Mime:
program method_init;

{$mode objfpc}
{.$mode delphi}

Type

 { TObj }

 TObj = Class
  class var
   a: record
    b: byte;
   end;
   procedure Test;
 end;

{ TObj }

procedure TObj.Test;
Var

 proc : procedure of object;
 p : pbyte;
begin
  a.b:=5;
  p:=@tobj.create.a.b;
  if p^<>5 then
    halt(1);
end;

procedure UncompilableProc;
Var

 proc : procedure of object;
 p : pbyte;
begin
  tobj.a.b:=6;
  p:=@tobj.create.a.b;
  if p^<>6 then
    halt(2);
end;

begin

  WriteLn('Mode: ', {$IFDEF FPC_DELPHI}'delphi'{$ELSE}'objfpc'{$ENDIF});

  TObj.Create.Test;
  UncompilableProc;

end.