mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-05 16:38:25 +02:00

+ uses getref for extracting error code + required command lines args can be place in the first line of source code following $OPT=
34 lines
486 B
ObjectPascal
34 lines
486 B
ObjectPascal
{ $OPT=-S2
|
|
}
|
|
type
|
|
tclass = class of tobject;
|
|
|
|
tmyclass = class of tmyobject;
|
|
|
|
tmyobject = class
|
|
end;
|
|
|
|
{ only a stupid test routine }
|
|
function getanchestor(c : tclass) : tclass;
|
|
|
|
var
|
|
l : longint;
|
|
|
|
begin
|
|
getanchestor:=tobject;
|
|
l:=l+1;
|
|
end;
|
|
|
|
var
|
|
classref : tclass;
|
|
myclassref : tmyclass;
|
|
|
|
begin
|
|
{ simple test }
|
|
classref:=classref;
|
|
{ more difficult }
|
|
classref:=myclassref;
|
|
classref:=tobject;
|
|
|
|
classref:=getanchestor(myclassref);
|
|
end. |