mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-05-10 21:22:52 +02:00
52 lines
730 B
ObjectPascal
52 lines
730 B
ObjectPascal
{ $OPT=-S2 }
|
|
{ classes need objpas !! }
|
|
{ needed to intercept GPF (PM) }
|
|
{$ifdef go32v2}
|
|
uses dpmiexcp;
|
|
{$endif go32v2}
|
|
|
|
type
|
|
tobject2 = class
|
|
i : longint;
|
|
procedure y;
|
|
constructor create;
|
|
class procedure x;
|
|
class procedure v;virtual;
|
|
end;
|
|
|
|
procedure tobject2.y;
|
|
|
|
begin
|
|
Writeln('Procedure y called');
|
|
end;
|
|
|
|
class procedure tobject2.v;
|
|
|
|
begin
|
|
end;
|
|
|
|
class procedure tobject2.x;
|
|
|
|
begin
|
|
v;
|
|
end;
|
|
|
|
constructor tobject2.create;
|
|
|
|
begin
|
|
end;
|
|
|
|
type
|
|
tclass2 = class of tobject2;
|
|
|
|
var
|
|
a : class of tobject2;
|
|
object2 : tobject2;
|
|
|
|
begin
|
|
a:=tobject2;
|
|
a.x;
|
|
tobject2.x;
|
|
object2:=tobject2.create;
|
|
object2:=a.create;
|
|
end. |