summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/test/toperator10.pp
blob: c4a7f90b9eaac5fd019167c714c2eacf0227b98d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{ %fail}
program toperator10;

{$mode delphi}

type
  TFoo = record
    F: Integer;
  end;

// don't allow class operator declaration outside the class
class operator Add(A, B: TFoo): TFoo;
begin
  Result.F := A.F + B.F;
end;

begin
end.