blob: 7bc32b6e2211b0fee0e47f169474065f775041a0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
{$ifdef fpc}{$mode objfpc}{$H+}{$endif}
type
TMyClass = class
public
constructor Create;
procedure Assign(v:pointer);virtual;
end;
var
i : longint;
constructor TMyClass.Create;
begin
writeln('TMyClass.Create');
inc(i);
end;
procedure TMyClass.Assign(v:pointer);
begin
end;
function CreateMyClass: TMyClass;
begin
Result:=TMyClass.Create;
end;
var
Item: TMyClass;
begin
CreateMyClass.Assign(nil);
if i<>1 then
begin
writeln('Error!');
halt(1);
end;
end.
|