[fpc-devel] WTF? Type checking dependent on compilation mode!?

Florian Klaempfl florian at freepascal.org
Mon Apr 25 14:10:57 CEST 2005


Vinzent Hoefler wrote:
> Hi,
> 
> consider this piece of code:
> 
> -- 8< -- snip --
> type
>    tA = array[0 .. 5] of byte;
>    tB = array[0 .. 5] of byte;
> 
> var
>    A : tA;
>    B : tB;
> 
> begin
>    FillChar (A, SizeOf (A), 0);
> 
>    B := A;     // <-- should by type error!
>    A := tA(B);
> end.
> -- 8< -- snip --

It's simply a thing to make life easier especially for beginners. I
don't know a real reason why the arrays shouldn't be considered equal so
fpc doesn't complain either ;)

> 
> 
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel





More information about the fpc-devel mailing list