summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/test/tforin10.pp
blob: 156e43730340cd340991f5843f832312972117fa (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
{ %FAIL}

// test that it is imposible to use non-valid enumerator operator

program tforin10;

{$mode objfpc}{$H+}
{$apptype console}

type
  TSomeClass = class
  end;

  TSomeClassEnumerator = class
  end;

operator enumerator(s1, s2: TSomeClass): TSomeClassEnumerator;
begin
  Result := nil;
end;

var
  s: TSomeClass;
  c: char;
begin
  for c in s do
    write(c);
end.