[fpc-devel] Re: Testing for..in feature
klenin at gmail.com
Wed Nov 4 13:43:30 CET 2009
On Wed, Nov 4, 2009 at 22:36, Paul Ishenin <webpirat at mail.ru> wrote:
> Alexander Klenin wrote:
>> Yet another bug:
>> type T = (a1, b1=5);
>> ch: T;
>> for ch in T do Writeln(ch);
> This is caused by the problem in the for-to loop:
> for ch := Low(T) to High(T) do
> How should I solve the problem in the for-in loop?
> I tried the next way:
> ch := Low(T);
> while ch <= High(T) do
> But it fails the same way.
ch := succ(ch);
OTOH, I am not sure -- obviously either Succ or Inc is buggy, but which one?
Maybe runtime instead of compile-time error is actually correct?
Alexander S. Klenin
More information about the fpc-devel