operators in different units problem

This commit is contained in:
pierre 2000-04-07 12:25:25 +00:00
parent f6a7349bb4
commit dc58ddc5a4
3 changed files with 55 additions and 0 deletions

15
tests/test/testop.pp Normal file
View File

@ -0,0 +1,15 @@
uses
testop1,testop2;
var
a,b,c : op1;
d,e,f : op2;
begin
a.x:=67;a.y:=-45;
b.x:=89;b.y:=23;
c:=a+b;
e.x:=67;e.y:=-45;
f.x:=89;f.y:=23;
d:=e+f;
end.

20
tests/test/testop1.pp Normal file
View File

@ -0,0 +1,20 @@
unit testop1;
interface
type
op1 = record
x,y : longint;
end;
operator + (const a,b : op1) c : op1;
implementation
operator + (const a,b : op1) c : op1;
begin
c.x:=a.x+b.x;
c.y:=a.y+b.y;
end;
end.

20
tests/test/testop2.pp Normal file
View File

@ -0,0 +1,20 @@
unit testop2;
interface
type
op2 = record
x,y : longint;
end;
operator + (const a,b : op2) c : op2;
implementation
operator + (const a,b : op2) c : op2;
begin
c.x:=a.x+b.x;
c.y:=a.y+b.y;
end;
end.