mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-12 19:29:28 +02:00

- fix for-in loop for string const array - add some test from Alexander S. Klenin (issue #0014990) git-svn-id: trunk@14041 -
30 lines
375 B
ObjectPascal
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.
|
|
|