mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-28 18:21:34 +01:00
* check added
This commit is contained in:
parent
2584bd9df4
commit
6263453375
39
tests/webtbs/tw2332.pp
Normal file
39
tests/webtbs/tw2332.pp
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{ Source provided for Free Pascal Bug Report 2332 }
|
||||||
|
{ Submitted by "Sergey Kosarevsky" on 2003-01-21 }
|
||||||
|
{ e-mail: netsurfer@au.ru }
|
||||||
|
|
||||||
|
{$static on }
|
||||||
|
|
||||||
|
Type tObject=Object
|
||||||
|
Constructor Init;
|
||||||
|
Function GetVMT:Pointer;Static;
|
||||||
|
Destructor Done;Virtual;
|
||||||
|
End;
|
||||||
|
|
||||||
|
Function tObject.GetVMT:Pointer;
|
||||||
|
Begin
|
||||||
|
Exit(TypeOf(Self));
|
||||||
|
End;
|
||||||
|
|
||||||
|
Constructor tObject.Init;
|
||||||
|
Begin
|
||||||
|
End;
|
||||||
|
|
||||||
|
Destructor tObject.Done;
|
||||||
|
Begin
|
||||||
|
End;
|
||||||
|
|
||||||
|
Var O:tObject;
|
||||||
|
|
||||||
|
Begin
|
||||||
|
O.Init;
|
||||||
|
WriteLn(Longint(TypeOf(tObject)));
|
||||||
|
WriteLn(Longint(O.GetVMT));
|
||||||
|
WriteLn(Longint(tObject.GetVMT));
|
||||||
|
if (O.GetVMT<>TypeOf(tObject)) or (TypeOf(tObject)<>tObject.GetVMT) then
|
||||||
|
begin
|
||||||
|
writeln('Error with typeof');
|
||||||
|
halt(1);
|
||||||
|
end;
|
||||||
|
End.
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user