Adam Naumowicz wrote:
On Sun, 14 Oct 2001, Frank Heckenbach wrote:
Adam Naumowicz wrote:
Hello, I would like to know what is the reason why GPC complains about type mismatch compiling lines like below: ....... var a:array[0..10] of integer;
function at(const index:integer):integer; begin at:=a[index]; end; ....... It seems to me, that there is a too rigid type checking in this matter. Why are constants not allowed here ?
My compiler fails on the `.......' which is not a valid start of a Pascal program.
In other words: Please post complete test programs!
I'm just back from a 3 days conference, and found more than 100 mails waiting for me, so I really don't feel like completing such code fragments, sorry.
Sorry for that. I know the filling quite well, too ;-) This test was so straightforward that I was too lazy to form a program from it, but of course I'll send complete test programs in future.
The problem turned out quite a bit more extensive, but fortunately easy to fix:
* 20011015: wrong type mismatches with `const' and `protected' parameters used as array indexes, as case selectors, in writing to typed files, in `Include', `Exclude', `in', in set assignments, or in file seeks (adam3[a-v].pas, chief31.pas)
Frank