fpc/tests/test/tforin10.pp
paul 5752be310d compiler:
- fix for-in loop for string const array
  - add some test from Alexander S. Klenin
(issue #0014990)

git-svn-id: trunk@14041 -
2009-11-04 12:07:42 +00:00

30 lines
375 B
ObjectPascal

{ %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.