summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/tbs/tb0222.pp
blob: ba2ec84580f82aa2f1f747a884becc20fc4709fc (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
{ Old file: tbs0261.pp }
{ problems for assignment overloading                  OK 0.99.12a (PM) }

program bug0261;

{ test for operator overloading }
{ Copyright (c) 1999 Lourens Veen }
{ why doesn't this work? }
uses
  erroru,
  ub0222;


var a : mythingy;
    b : myotherthingy;
    c : mythirdthingy;
begin
  a.x:=55;
  a.y:=45;
  a.c:=7;
  b:=a;
  c:=a;
  if b.d<>c.e then
    begin
      Writeln('Error in assignment overloading');
      Halt(1);
    end;
  if b<>c then
    begin
      Writeln('Error in equal overloading');
      Halt(1);
    end;
  Writeln('Sizeof(mythirdthingy)=',sizeof(mythirdthingy));
  Writeln('Sizeof(mynewthingy)=',sizeof(mynewthingy));
end.