[fpc-pascal] private type and type compatibility

Xiangrong Fang xrfang at gmail.com
Wed Oct 30 14:49:44 CET 2013


2013/10/30 Martin <lazarus at mfriebe.de>

>
> I think there is no problem with:
>
> var
>   a: array of Integer
> begin
>   A:= obj.proc;
>
> You are NOT using the type. You are using the value.
>

pascal is strong-typed.  You are actually using type along with its value.
 e.g.

var
  a: array of Double;
begin
  a := obj.proc;​​

This will emit a COMPILE time error because compiler know these 2 types are
not compatible.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20131030/b5faab0c/attachment.html>


More information about the fpc-pascal mailing list